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:
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.
Sources and Tools:
Data on coronavirus cases was obtained from covidtracking.com. The visualization was created using javascript and the open source leaflet javascript mapping library.Each state has two senators in the Senate, even though there is a great disparity in the populations of the states. This was a compromise that the framers of the Constitution dealt with in creating the framework of the US government. While the US House of Representatives is based on proportional representation, the Senate was designed to have two senators per state regardless of population. This leads to some interesting variations in the number of votes that some senators get relative to other senators (and how many people they represent).
This graph is called a treemap and shows the total number of votes cast for the winner of each senate race of the current sitting senators. They are shown in order from largest to smallest vote totals, where the area of the rectangle is proportional to the number of votes. The treemap can be organized by party if desired. This graph does not show the number of votes that their opponents got.
If you hover over (click, on mobile) one of the boxes in the treemap, you can compare the number of votes received by that senator to the number of senators that received the same number of votes combined. This helps highlight the disparities in the representation of voters in large states in the Senate relative to that of voters in states with low populations.
For example, Kamala Harris, Democratic senator of my home state of California, received 7.5 million votes when she won her senate race in 2016. This large number of votes is larger than the combined votes for 22 of her Republican colleagues in small states. This is even more impressive since, as noted before, she ran against another Democrat Loretta Sanchez, in the election.
Note that some of the recently elected senators shown in the table are no longer serving in the Senate:
Because of the large variation in population sizes and a tendency for more populous states to vote for democrats, Democratic Senators received many more votes in their elections than their Republican colleagues did, despite having fewer numbers. The 47 Democratic (and Independent) senators received a total of 67.5 million votes while the 53 Republican senators received 59.5 million votes.
This graph shows a slightly different set of data. Instead of total votes for the winning candidate, it shows the vote margin (i.e. the number of votes the winner received vs the opponent of a different party). The reason I specify it this way is that the two Democratic California senators defeated other democrats to win their elections (i.e. no republican was on the ballot in the general election because no republican got enough votes in the primary). This comparison is interesting because not only do some senators receive very few votes (because they live in small states), but they may only win by a small margin over their opponents. Comparing margins of victory, shows how few votes it would take to “flip” a Senate seat between the two parties.
If you take Kamala Harris’s margin of victory over Republicans to be her vote total (7.5 million votes) since there was no Republican running against her, her margin of victory is greater than the margin of victory of 43 of her Republican Senate colleagues combined.
Sources and Tools:
Senate election data was downloaded from MIT election lab. The data was processed using python/pandas and the visualization was created using javascript and plotly.js, the open source javascript graphing library.
function resizeframe(){ //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 (){ graph = document.getElementById('graphframe'); graph.height = graph.contentWindow.document.body.scrollHeight+40+"px"; console.log("resize1"); }, 50); }
function resizeframe2(){ //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 (){ graph2 = document.getElementById('graphframe2'); graph2.height = graph2.contentWindow.document.body.scrollHeight+40+"px"; console.log("resize2"); }, 50); }
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.
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('mapframe'); mm.height = mm.contentWindow.document.body.scrollHeight+100+"px"; console.log("resize");
}, 150); }
function reloadiframes(){ document.getElementById('mapframe').contentWindow.location.reload(); }
window.addEventListener("orientationchange", function() { reloadiframes(); resizemap(); }, false);
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:
Each of these is also calculated per 100,000 population in the state:
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.
function resizeMapFrame(){ //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('mapframe'); mm.height = mm.contentWindow.document.body.scrollHeight+60+"px"; console.log("resize");
}, 150); }
function reloadiframes(){ document.getElementById('mapframe').contentWindow.location.reload(); }
window.addEventListener("orientationchange", function() { reloadiframes(); resizeMapFrame(); }, false);
Americans are known for loving cars and driving quite a bit. Drivers in the United States own more cars and drive more than those in any other country. So what kinds of vehicles do Americans drive? This visualization looks at the types of vehicles (by body type and country of origin) across the 50 States and Washington DC.
You can view two different attributes about the types of vehicles in use in the United States:
The different categories of passenger vehicles include:
Classification of the vehicles manufacturer (US, Asia or Europe) is based on the company’s headquarters and not the place of vehicle manufacturing. So a Toyota here is an Asian vehicle even if it was assembled in Mississippi.
It is pretty interesting to see the regional differences in vehicle types (cars vs trucks and SUVs) and vehicle brand (domestic vs foreign). Michigan, especially, stands out with their very high domestic ownership. It makes sense as Detroit is the home of the big three US auto manufacturers (Ford, GM and Chrysler). And I hear there’s a very strong culture of owning American cars there (and employee, friends and family discounts as well).
The data is derived from a survey by the US Department of Transportation called the National Household Travel Survey (NHTS) released in 2017. The following is a quote from the NHTS webpage:
The National Household Travel Survey (NHTS) is the source of the Nationβs information about travel by U.S. residents in all 50 States and Washington, DC. This inventory of travel behavior includes trips made by all modes of travel (i.e., private vehicle, public transportation, pedestrian, and cycling) and for all purposes (e.g., travel to work, school, recreation, and personal/family trips). It provides information to assist transportation planners and policymakers who need comprehensive data on travel and transportation patterns in the United States.
Data and Tools:
Data, as stated before, comes from the US Department of Transportation’s National Household Travel Survey (NHTS). That data was processed to identify vehicle characteristics by state and plotted using javascript and the open-source leaflet map 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('mapframe'); mm.height = mm.contentWindow.document.body.scrollHeight+20+"px";
mobilewarn();
}, 150); }
function reloadiframes(){ document.getElementById('mapframe').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();
Recent Comments