Data Science Texts

Diversions

NB: We may earn a commission if you buy something via an affiliate link.

Relative Populations of U.S. States over Time

State areas are proportional to their populations. The animation can be stopped by clicking anywhere on the map; data for a given census can be viewed by adjusting the sliders. Mouse over states to read their population.

Data Notes

Synopsis

The field of cartography is one of the most prolific generators of interesting visualizations, and one of my favorite examples of this is the cartogram. Other methods of mapping values to regions, such as chloropleths, still suffer from the fact that the dominant visual attribute of a map region is that region's area. Cartograms solve that problem.

Weaknesses of the Visualization

There are three main weaknesses to this visualization in my view:
  1. The year slider and the corresponding change in population are not perfectly in sync. The slider advances a whole decade instantly, and then the map catches up.

    I'm not sure what the problem is, but for some reason I cant get the transition of the year slider and the cartogram to sync up. I could solve this problem by interpolating the populations between decades and simply having a lot more transitions, but generating the cartogram requires a relatively large amount of computation, so I worry performance would suffer.

  2. Color is not doing as much as it might be able to.

    I gave each state a distinct color because some of the states are hard to recognize by shape. However, it would be nice to get another variable on the map.

  3. The populations of sparsely inhabited states are fudged somewhat.

    The cartogram routine I'm using can't seem to handle zero-area regions, so if there is no population data available for a state in a given year or its population is smaller than 0.1% of the most populous state, it is assigned an area corresponding to 0.1% of the population of the most populous state. I don't think this makes a big difference in the visual, but it is a small change.

If you found this graphic interesting, check out the recommended reads.

Data Sources

Acknowledgments

The underlying cartogram code is based on two libraries, cartogram-chart and topogram. This visualization was created using R and D3. The following packages were particularly helpful: