Posts for Tag: population

Visualizing the scale of unemployment due to COVID-19 pandemic

Posted In: Unemployment

The number of Americans who have recently filed for unemployment due to the coronavirus pandemic is equal to the entire labor force of several states put together.

click on the button below to see a new set of states.

A record 16 million Americans just filed for unemployment due to the coronavirus pandemic at the end of March and early April 2020. This is an amazingly large number of people and I wanted to visualize how many people this actually is. For context, the US Department of Labor statistics states that in February 2020 (before the pandemic hit the United State) there were 164.2 million workers in the Civilian Labor Force.

The Bureau of Labor Statistics (BLS) site defines “Civilian Labor Force” as such:

    “The labor force includes all people age 16 and older who are classified as either employed and unemployed, as defined below. Conceptually, the labor force level is the number of people who are either working or actively looking for work.”

This basically means that approximately 10% of the entire workforce of people (both employed and unemployed in Feb 2020) are now out of a job. While 10% is a large, unprecedented number in our lifetimes, comparing these number to the size of the workforce in several states helps to provide more context. The visualization shows a random collection of states whose total labor force is equal to the latest unemployment numbers. If you click the button you can see a different set of states that have the same total labor force.

Predictions are that the number of unemployed will grow as the shutdowns and social distancing measures to contain the virus continue through April and into May. I will update this graph to reflect new numbers as they come out.

And we can only hope that people will be able to manage these tough economic times until we contain the virus and the economy rebounds.

Stay safe out there: stay away from people and wash your hands!

Sources and Tools:

Data on unemployment was obtained from the US Department of Labor website and labor force numbers by state are downloaded from the Bureau of Labor statistics. And the visualization was created using javascript and the open source leaflet javascript mapping library.

US city names

Mapping US Cities By Name

Posted In: Geography | Maps

This map of the United States visualizes over 28,000 cities in the 50 states. The interactive visualization lets you type in a name (or part of a name) and see all of the cities that contain those string of letters. The points on the map show the geographic center of each city.

For example, if you type in “N”, you will highlight all cities that start with an N in the US. As you type in another letter (e.g. “e”, it will narrow down the cities that begin with those two letters (“Ne”). It will progressively narrow down the number of cities as you type in more letters. You can see an scrollable list of the cities (ordered by city population) that contain the string of letter that you have typed.

If you hover over a highlighted city, you can see the name of the city.

You can click on the check box to show or hide the outlines of the states.

You can “Show City List” to show the list of cities that contain the string of letters you have typed.

Sources and Tools:

City name and location data was downloaded from simplemaps.com. And the visualization was created using javascript and the open source leaflet javascript mapping library.

US city names

US County Electoral Map – Land Area vs Population

Posted In: Maps | Voting
county election map 2020

County-level Election Results from 2020 and 2016

The map has been updated to include the latest 2020 results and also adds the option to color the circles by the win margin rather than just looking at the winner.
Click here to view a visualization that looks more explicitly at the correlation between population density and votes by county.
This interactive map shows the election results by county and you can display the size of counties based on their land area or population size.

Previously, I created a map (cartogram) that showed the state by state electoral results from the Presidential Election by scaling the size of the states based on their electoral votes. The idea for that map was that by portraying a state as Red or Blue, your eye naturally attempts to determine which color has a greater share of the total. On a normal election map, Red states dominate, especially because a number of larger, less populated states happen to vote Republican. That cartogram changed the size of the states so that large states with low population, and thus low electoral votes tended to shrink in size, while smaller states with moderate to larger populations tended to grow in size. Thus, when your eyes attempt to discern which color prevails, the comparison is more accurate and attempts to replicate the relative ratio of electoral votes for each side.

This map looks at the 2020 and 2016 presidential election results, county by county. An interesting thing to note is that this view is even more heavily dominated by the color red, for the same reasons. Less densely populated counties tend to vote republican, while higher density, typically smaller counties tend to vote for democrats. As a result, the blue counties tend to be the smaller ones so blue is visually less represented than it should be based on vote totals. More than 75% of the land area is red, when looking at the map based on land areas, while shifting to the population view only about 46% of the map is red. Neither of these percentages is exactly correct because each county is colored fully red or blue and don’t take into account that some counties are won by a large percentage and some are essentially tied. However, the population number is certainly closer to reality as Trump won about 48.8% of the votes that went to either Trump or Clinton.

Instructions

This tool should be relatively straightforward to use. Just click around and play with it.
The map has a few different options for display:

  • Hide Circles – just shows the county map
  • Show land circles – where the area of the circle matches the area of the county itself, though obviously shaped like a circle. The counties are colored red or blue depending on whether Trump or Biden (in 2020) or Clinton (in 2016) won more votes in that county.
  • Show population circles – where the area of the circle matches the relative population of the county itself. More populated counties will grow larger while less populated counties will shrink. The counties are colored red or blue depending on whether Trump or Biden or Clinton won more votes in that county.
  • Selecting the No County Overlap checkbox will spread out all of the circles so you can see them all. The total displayed area of the county circles is the same in either land and population view, though if the circles are overlapping, you may see less total colors.
  • Selecting the Color by Margin checkbox will color the each county circle by the amount that a candidate won the county. If the vote margin is small, the county will be colored light blue or red, whereas if a county strongly favors one candidate, it will be colored darker red or blue.

Visualization notes

This was my second attempt at using d3 to generate visualizations. I typically use leaflet to do web-based mapping but I wanted the power of d3 which has functions for the circles to prevent overlapping. This map was inspired by Karim Douieb’s cool visualization of 2016 election results. I modified it in a number of different ways to try to make it more interactive and useful.

This visualization does not actually simulate the collisions between the circles on your browser. It is a bit computationally taxing and causes my computer fan to turn on after awhile. So instead I ran the simulation on my computer and recorded the coordinates for where each circle ended up for each category. Then your browser is simply using d3 transitions to shift positions and sizes of the circles between each of the maps, which is simpler, though with 3142 counties, it can still tax the computer occasionally.

Data and Tools
County level election data for 2016 is from MIT Election Lab. The 2020 county level data is downloaded from the New York Times county election data API and processed using a python script. Population data used is for 2018. The visualization was created using d3 javascript visualization library.

Assembling the USA state-by-state with state-level statistics

Posted In: Maps

Watch the United States assemble state by state based on statistics of interest

Based on earlier popularity of the country-by-country animation, this map lets you watch as the world is built-up one state at a time. This can be done along a large range of statistical dimensions:

  • Name (alphabetical)
  • abbreviation
  • Date of entry to the United States
  • State Population (2018)
  • Population per Electoral Vote (2018)
  • Population per House Seat (2018)
  • Land Area (square miles)
  • Population Density (ppl per sq mi) (2018)
  • State’s Highest Point
  • Highest Elevation (ft)
  • Mean Elevation (ft)
  • State’s Lowest Point
  • Lowest Point (ft)
  • Life Expectancy at Birth (yrs)
  • Median Age (yrs)
  • Percent with High School Education
  • Percent with Bachelor’s Degree
  • Residential Electricity Price (cents per kWh) (2018)
  • Gasoline Price ($/gal) Regular unleaded (2019)
  • State Gross Domestic Product GDP ($Million) (2018)
  • GDP per capita ($/capita)
  • Number of Counties (or subdivisions)
  • Average Daily Solar Radiation (kWh/m2)
  • Birth rate (per thousand population)
  • Avg Age of Mother at Birth
  • Annual Precipitation (in/yr)
  • Average Temperature (deg F)
  • These statistics can be sorted from small to large or vice versa to get a view of the US and its constituent states plus DC in a unique and interesting way. It’s a bit hypnotic to watch as the states appear and add to the country one by one.

    You can use this map to display all the states that have higher life expectancy than the Texas:
    select “Life expectancy”, sort from “high to low” and use the scroll bar to move to the Texax and you’ll get a picture like this:
    States with higher life expectancy than Texas

    or this map to display all the states that have higher population density than California:
    select “Population density, sort from “high to low” and use the scroll bar to move to the United States and you’ll get a picture like this:
    States with higher population density than California

    I hope you enjoy exploring the United States through a number of different demographic, economic and physical characteristics through this data viz tool. And if you have ideas for other statistics to add, I will try to do so.

    Data and tools: Data was downloaded from a variety of sources:

    • Population https://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States_by_population
    • Admission to union https://simple.wikipedia.org/wiki/List_of_U.S._states_by_date_of_admission_to_the_Union
    • Educational attainment https://nces.ed.gov/programs/digest/d18/tables/dt18_104.88.asp
    • Highest points https://geology.com/state-high-points.shtml
    • Life expectancy https://en.wikipedia.org/wiki/List_of_U.S._states_and_territories_by_life_expectancy
    • Median Age http://www.statemaster.com/graph/peo_med_age-people-median-age
    • Land area https://statesymbolsusa.org/symbol-official-item/national-us/uncategorized/states-size
    • Mean elevation https://www.census.gov/library/publications/2011/compendia/statab/131ed/geography-environment.html
    • Electricity price https://www.chooseenergy.com/electricity-rates-by-state/
    • Gasoline price https://gasprices.aaa.com/state-gas-price-averages/
    • GDP https://www.bea.gov/data/gdp/gdp-state
    • Sunlight North America Land Data Assimilation System (NLDAS) Daily Sunlight (insolation) for years 1979-2011 on CDC WONDER Online Database, released 2013. Accessed at http://wonder.cdc.gov/NASA-INSOLAR.html on Jun 14, 2019 1:37:15 PM
    • Births United States Department of Health and Human Services (US DHHS), Centers for Disease Control and Prevention (CDC), National Center for Health Statistics (NCHS), Division of Vital Statistics, Natality public-use data 2007-2017, on CDC WONDER Online Database, October 2018. Accessed at http://wonder.cdc.gov/natality-current.html on Jun 14, 2019 1:53:58 PM
    • Precipitation North America Land Data Assimilation System (NLDAS) Daily Precipitation for years 1979-2011 on CDC WONDER Online Database, released 2013. Accessed at http://wonder.cdc.gov/NASA-Precipitation.html on Jun 26, 2019 3:30:40 PM
    • Temperature http://www.usa.com/rank/us–average-temperature–state-rank.htm

    The map was created with the help of the open source leaflet javascript mapping library

    Assembling the World Country-By-Country

    Posted In: Maps

    Watch the world assemble country-by-country based on a specific statistic




    This map lets you watch as the world is built-up one country at a time. This can be done along the following statistical dimensions:

    • Country name
    • Population – from United Nations (2017)
    • GDP – from United Nations (2017)
    • GDP per capita
    • GDP per area
    • Land Area – from CIA factbook (2016)
    • Population density
    • Life expectancy – from World Health Organization (2015)
    • or a random order

    These statistics can be sorted from small to large or vice versa to get a view of the globe and its constituent countries in a unique and interesting way. It’s a bit hypnotic to watch as the countries appear and add to the world one by one.

    You can use this map to display all the countries that have higher life expectancy than the United States:
    select “Life expectancy”, sort from “high to low” and use the scroll bar to move to the United States and you’ll get a picture like this:
    Countries with higher life expectancy than US

    or this map to display all the countries that have higher population density than the United States:
    select “Population density, sort from “high to low” and use the scroll bar to move to the United States and you’ll get a picture like this:
    Countries with higher population density than US

    I hope you enjoy exploring the countries of the world through this data viz tool. And if you have ideas for other statistics to add, I will try to do so.

    Data and tools: Data was downloaded primarily from Wikipedia: Life expectancy from World Health Organization (2015) | GDP from United Nations (2017) | Population from United Nations (2017) | Land Area from CIA factbook (2016)
    The map was created with the help of the open source leaflet javascript mapping library

    function resizemap(){ //this function is called from the javascript from within the iframe after the contents of iframe are loaded (and after an additional 150ms delay) setTimeout(function (){ mm = document.getElementById('molleweide'); mm.height = mm.contentWindow.document.body.scrollHeight+20+"px";

    mobilewarn();

    }, 150); }

    function reloadiframes(){ document.getElementById('molleweide').contentWindow.location.reload(); }

    window.addEventListener("orientationchange", function() { reloadiframes(); resizemap(); mobilewarn(); }, false);

    function mobilewarn(){ w=window.innerWidth; if (w<600){ document.getElementById('mobilewarning').innerHTML="On mobile devices, visualizations are best viewed in landscape mode."; } else { document.getElementById('mobilewarning').innerHTML=""; } } mobilewarn();

    World Population Distribution by Latitude and Longitude

    Posted In: Maps

    How is population distributed by latitude and longitude

    This interactive map shows how population is distributed by latitude or longitude. It animates the creation of a bar graph by shifting population from its location on the map to aggregate population levels by latitude or longitude increments. Each “block” of the bar graph represents 1 million people. Population is highest in the northern hemisphere at 25-26 degrees North latitude and 77-78 degrees East Longitude.

    Instructions:

    It should be relatively explanatory. Press the “Aggregate Population by Latitude” button to make a plot of population by line of latitude (i.e. rows of the map).
    Press the “Aggregate Population by Longitude” button to make a plot of population by line of longitude (i.e. columns of the map). To see the population distributed across the map, press the “Show Population Grid” button.

    This map was inspired by some mapping work done by neilrkaye on twitter and reddit.

    Data Sources and Tools:
    This map projection is an equirectangular projection. Data on population density comes from NASA’s Socioeconomic Data and Applications Center (SEDAC) site and is displayed at the 1 degree resolution. This interactive visualization is made using the awesome leaflet.js javascript library.

    population by longitude and latitude