Case Study US County Choropleth

Date
May 2022
Client
Kenneth B., statistical researcher

An interactive, movable and zoomable map of all United States counties, each of which can be selected and assigned into color-coded groups that list the population of each county as well as of the total region. The app was built for a client doing statistical research.

Tech Stack

  • D3.js icon D3.js
  • Vue.js icon Vue.js
  • JavaScript icon JavaScript
  • CSS icon CSS
  • HTML icon HTML
The map of US counties and its basic interactivity - panning, zooming, and county selection - was built using the D3 JavaScript library. The user interface surrounding the map - such as the sidebar displaying the statistics or the save and load modals - were made with the help of Vue.js.

Interactive Map

The main page of the app features an interactive map of all US counties, which the user can pan around and zoom in and out of.

Color-Coded Selections

When the 'Selecting' checkbox at the top is on, the user can click on counties to select them. Each selected county is placed inside a group with counties that were marked with the same color. These groupings appear on the sidebar, to the right of the map, and feature populations for each county, as well as the total population for the group. Each group can also be assigned a custom name. To create a new group or return to a previously applied color, the user can choose from the color picker options at the top of the sidebar.

Saving Maps

The option in the top-right corner of the navbar opens a modal, which can be used to save the current map. As the app isn't running a database, the save function works by generating a shortcode, which represents all current selections. The user can then save this code on their computer - in a text file, for example.

Loading Maps

Another option in the top-right corner of the navbar open the load modal, where a user can input a previously-saved shortcode to re-generate an older map.