Visualizing State Vehicle Registrations: A Web-Hosted Interactive Application

The dataset used in this project consists of U.S. state-level motor vehicle registrations, spanning various vehicle types such as automobiles, trucks, motorcycles, and buses. In addition to registration data, population data is merged with the main dataset to calculate vehicle registrations per capita.

8/19/20243 min read

worm's eye-view photography of ceiling
worm's eye-view photography of ceiling

Visualizing State Vehicle Registrations with Dash: A Web-Hosted Interactive Application

Click to see application

Introduction

Data visualization has become an essential tool for making complex datasets accessible and insightful. In this article, we explore how we used Dash by Plotly to create an interactive dashboard that visualizes historical motor vehicle registrations across U.S. states. Furthermore, we’ll demonstrate how this interactive application is hosted on Heroku, allowing it to be easily accessed and used online without any need for local setup.

Project Overview

The dataset used in this project consists of U.S. state-level motor vehicle registrations, spanning various vehicle types such as automobiles, trucks, motorcycles, and buses. In addition to registration data, population data is merged with the main dataset to calculate vehicle registrations per capita.

We created interactive visuals to:

1. Explore trends over time for vehicle registrations across all U.S. states.

2. Compare vehicle types within a state or across states.

3. Analyze relationships between different vehicle categories, such as the correlation between truck and automobile registrations.

Interactive Visuals

The dashboard, built with Dash, offers a wide range of interactive visualizations, allowing users to explore vehicle registration trends by state, vehicle type, and year. Below are the key visuals included in the app:

1. Choropleth Map of Vehicle Registrations

Purpose: Visualize the distribution of different types of vehicle registrations across the U.S. states in a selected year.

Interaction: Users can select a vehicle category (e.g., autos, trucks, motorcycles) and a specific year to view a color-coded map of the U.S. states. The color intensity represents the number of registrations.

Details: By hovering over a state, users can see detailed data on the number of vehicles registered, broken down by category.

2. Choropleth Map of Vehicle Registrations Per Capita

Purpose: Show the number of vehicles per 1,000 people across states, normalized by population.

Interaction: Users can select a vehicle category and year, and view the map shaded by per capita registrations. This visualization helps highlight states with high vehicle ownership relative to population.

Details: Hovering over each state reveals the number of vehicles per 1,000 residents.

3. Time Series Plot for a Selected State

Purpose: Track the change in vehicle registrations over time within a selected state.

Interaction: Users can choose a state from a dropdown menu and select which vehicle categories to display. The line chart dynamically updates to show the trends in registration counts from 1900 to 2020.

Details: This plot excludes data from 2020 to avoid distortions due to the COVID-19 pandemic.

4. Scatter Plot with Linear Regression

Purpose: Compare vehicle registrations across states for two different categories and fit a regression line.

Interaction: Users can select a year, and the scatter plot compares the number of automobiles and trucks registered in each state. A linear regression line is also drawn to visualize the relationship between the two categories.

Details: This plot provides insights into states where the registrations of automobiles and trucks are highly correlated.

5. Pie Chart of Vehicle Types by State

Purpose: Compare the proportions of different vehicle types within a state for a selected year.

Interaction: Users choose a state and a year, and the pie chart displays the distribution of automobiles, trucks, motorcycles, and buses within that state.

Details: This visualization helps identify the dominant vehicle types in each state.

6. Bar Chart of Vehicle Registrations Over Time

Purpose: Visualize the breakdown of vehicle registrations over time for a selected state.

Interaction: Users select a state, and the bar chart displays the registration counts for automobiles, trucks, motorcycles, and buses over the years.

Details: This chart provides a clear view of how each vehicle type has grown or declined over time within a state.

Hosting the Application on Heroku

Once the Dash app was developed, it was time to deploy it so that users can access it online. Heroku, a cloud platform service, makes this process simple and scalable.