Posts for Tag: map

Animation of Coronavirus Cases and Deaths in US

Posted In: Health | Maps

Visualize the large number of coronavirus cases and deaths in the US each day/hour in about 10 seconds

The rate of COVID-19 deaths and cases in the US is crazy high after the 2020 winter holidays and maybe still be going up. This visualization shows the number of COVID cases that occur in one hour or the COVID deaths that occur in one day based on the average of the last five days. This is another attempt to show the true scale of how many cases and deaths the US is dealing with, since it is often hard to understand large numbers. I have also attempted to show the scale of US deaths/cases here and here. Unfortunately, there are so many people getting sick and dying, it’s hard to fathom just how many people this actually is.

The 5-day averaging was done to smooth out any peaks and troughs in data reporting due to weekends/holidays, since I noticed that some states were literally reporting zero COVID cases some days while reporting many hundreds or thousands of cases other days.

The dots shown on the animation are located in the state that the cases or deaths occur but are randomly spread out within the state. This is done for visual clarity since if they were shown in their actual location, most of the dots would be overlapping in urban, high density areas. This approach lets you see which states have high COVID instances but still locate them by state.

You can share this animation by putting ?cat=deaths or ?cat=cases behind the url or copying and sharing one of these links:

  • https://engaging-data.com/animation-of-us-covid/?cat=cases
  • https://engaging-data.com/animation-of-us-covid/?cat=deaths
  • Sources and Tools:

    The coronavirus data comes from the covidtracking.com API. The data is parsed daily using a custom python script and visualizations are made using the open-source Leaflet javascript mapping library and the interface and animation are made using HTML/CSS/javascript.

    US covid case death animation

    Number of Electoral Votes by State in the 59 US Presidential Elections

    Posted In: Elections

    How many electoral votes did each state have across two centuries of elections?

    This animation shows the number of electoral votes each state had during each of the 59 presidential elections in US history between 1788 and 2020. It’s interesting to see the number of US states and their relative population sizes (in terms of electoral votes) over many different presidential elections. The population is counted every 10 years in the census so if a presidential election occurs between a census, it likely will not see any difference in numbers of electoral votes, unless something else happens (such as addition of a new state to the country).

    Instructions
    You can use the slider to control the election year to focus on a specific election and toggle the animation by hitting the Start/Stop button. Hovering over each state will tell you the number of electoral votes and the percentage of the total number of electoral votes in that election.

    In the elections during and immediately after the US Civil War, we also see some states whose electoral votes for president are not counted (shown in purple). Wyoming, the state with the lowest population in the US, has the highest number of electoral votes per person in the state, while the three most populous states, California, Florida and Texas have the least number of electoral votes per person. Wyoming has four times the number of electors per capita than these 3 states have (i.e. accounting for their population sizes). That will be the subject of another map dataviz.

    Here is another map that resizes the US states (i.e. shrink or grow) based on the number of electoral vote so that their electoral power is reflected in its size.

    Sources and Tools:

    Data on number of electoral votes by state for each election is from Wikipedia. And the visualization was created using javascript and the open source leaflet javascript mapping library.

    state borders

    Which State Borders the Most Other States?

    Posted In: Maps

    Interactive Choropleth of the Number of States That Border Each State

    This is a fun little map that shows the number of states that border each state. I’m working on improving the interactivity of maps and this was a good project to try this with. The base map is a choropleth map which color codes each state by the number of states it shares a border with. If you hover over (or touch on mobile) a state, it will highlight the state and show you (and list) the bordering states.

    It’s important to note that officially New York and Rhode Island share a water border (between Rhode Island and Long Island, NY) and that Michigan and Minnesota also share a border (in Lake Superior).

    Sources and Tools:

    Data on state borders was downloaded from state.1keydata.com. And the visualization was created using javascript and the open source leaflet javascript mapping library.

    state borders

    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

    Tracking US Coronavirus Cases by State

    Posted In: Maps

    The coronavirus (SARS-CoV-2) is literally affecting the entire globe right now and changing the way we live our lives here in the US and all over the world.

    There are quite a number of different coronavirus-related dataviz out there, but as we shelter-in-place I wanted to add a map that looked at a number of different metrics that tell us about the coronavirus pandemic by US states and look at those metrics on a population basis.

    There are a number of data sources that I’ve found that publish data about the coronavirus and the resulting disease (Covid-19) in the United States:

    This map is based on the data compiled from covidtracking.com, partly because it has a good API and also lists testing, cases and deaths. The data I’ve included on the map is:

    • Numbers of coronavirus cases – i.e. tested positive for virus
    • Numbers of coronavirus tests administered
    • Numbers of deaths due to coronavirus

    Each of these is also calculated per 100,000 population in the state:

    • Numbers of coronavirus cases per 100k people- i.e. tested positive for virus
    • Numbers of coronavirus tests administered per 100k people
    • Numbers of deaths due to coronavirus per 100k people

    These latter metrics are important because numbers of cases or deaths can be obscured by small or large populations but per capita data (or per 100k capita data) can point out interesting outliers.

    It is important to note that the data is far from perfect. There is probably significant underreporting of tests, cases and deaths. The data is a collection for the various local and state agencies that are working hard to deal with the medical, social and political ramifications of the pandemic, while also collecting data. We don’t know how many Americans have coronavirus because of lack of testing.

    Also important is that the number of positive cases is a function of how much testing is taking place so cases does not necessarily represent the exact prevalence of the virus, though there will probably be good correlation between cases and actual coronavirus infections. Luckily it sounds like tests are becoming more widely available so hopefully those numbers will go up sharply.

    For more information about the virus and the disease and data collection, you can find good information on the CDC website.

    Sources and Tools:

    Coronavirus cases are obtained from covidtracking.com. And the visualization was created using javascript and the open source leaflet javascript mapping library.

    coronavirus by state

    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