Corona visualizations
Collection of useful data visualizations about the Corona virus outbreak 2019/2020
Purpose of this notebook
The main purpose of this notebook is to create my own corona dashboard by pulling together interesting data visualizations I found elsewhere and adding some self-made visualizations.
I mainly want to play around with different types of visualizations and learn how to use them.
I attributed all sources correctly. Most dashboards were adopted from the amazing collection of https://covid19dashboards.com/.
Other interesting dashboards are:
Covid-19 deaths per million inhabitants
source: https://covid19dashboards.com/covid-compare-permillion/
Covid-19 confirmed cases per million inhabitants
source: https://covid19dashboards.com/covid-compare-permillion/
#collapse
alt.Chart(df_melted.query("country.isin(@flatten_countries)")).mark_circle(
opacity=0.8,
stroke='black',
strokeWidth=1
).encode(
alt.X('date:T', axis=alt.Axis(labelAngle=45)),
alt.Y('country:N'),
alt.Size('value:Q',
scale=alt.Scale(range=[0, 2000]),
legend=alt.Legend(title='confirmed cases')
),
alt.Color('country:N', legend=None)
).properties(
width=850,
height=820
).transform_filter(
alt.datum.Entity != 'All natural disasters'
)
Guessing the number of infected cases https://covid19dashboards.com/covid-infected/
lockdowns = {'Spain': '3/15/20',
'Italy': '3/10/20',
'Wuhan': '1/23/20',
'France': '3/15/20',
'Ireland': '3/12/20',
'Belgium': '3/15/20',
'Germany': '3/16/20'}
#for curr_country in lockdowns:
curr_country = 'Germany'
alt.Chart(new_cases_melted_df.loc[new_cases_melted_df['country'] == curr_country]).mark_bar().encode(
x='date:T',
y='new_cases:Q',
#color='country:N',
column='country:N',
color=alt.condition(
alt.datum.Year == '2020', # If the year is 1810 this test returns True,
alt.value('orange'), # which sets the bar orange.
alt.value('steelblue') # And if it's not true it sets the bar steelblue.
)
).properties(
title='Number of new cases by Country',
width=250,
height=140
).properties(width=600)