Covid-19 Dashboard for Bangladesh and Global perspective

Hafez Ahmad
4 min readMay 12, 2020

An interactive dashboard is a data management tool that tracks, analyzes, monitors, and displays all metrics while allowing users to interact with data, enabling them to make well-informed and data-driven decisions. Nowadays, the interactive dashboard becomes so popular because of its usefulness in all working spheres to see what really going on. There are many ways of making an interactive dashboard that you already noticed. But today, I am making it with the help of python. Because Python is a super-duper easy programming language and it has robust plotting packages.

I will use the following python packages [there are requirements named txt ]

1. Pandas [read my previous post]

2. Numpy [read my previous post]

3. Dash: Dash is a Python framework for building web applications. It built on top of Flask, Plotly. It enables you to build dashboards using pure Python.

4. Plotly: Plotly’s Python graphing library makes interactive, publication-quality graphs.

5. Datetime: it is a python default package.

Data sources: Data Repository by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University. This repository is so well known because they update COVID-19’s data every day.

I will follow six steps

1: conceptual design of dashboard [ divisions of pages for different components, plots, tables, and maps,].

2. Installation of required python packages and code editor [VS code is the best]

3. Dataset retrieving from GitHub and transformation for Global and Bangladesh

4: Selection of plotting [bar, line..] and tabulating

5: getting mapping Api key [I will use www.mapbox.com]. It is secret key

6: let’s make it happen.

files arrangement in the vs code

Now, let’s discuss what I did

At first, I downloaded confirmed, death, and recovered data from GitHub. Then I separated Bangladesh data and global data [all other affected countries].

Before starting you have to know how dash works?

1: header display

2: model div

3: content div

4: data source button

5: dashboard [span for just text]

6: # Top column display of confirmed, death and recovered total numbers and percentage

7: again div (# Graph of total confirmed, recovered and deaths)

8: again div for top eight countries named [ span named: Countries with highest cases: Single-day highest cases: Countries with the highest mortality: Single-day highest mortality]

9: again div for map and table

This section is so interactive, you select any country, it shows your country-specific map, plots.

On the top, there are three sections:

a. Total Cases: Total Deceased, Total Recovered: so I need to add functionality

b. Then scatter Plot and line plot

c. Again tabular section: Countries with highest cases: Single-day highest cases: Countries with the highest mortality: Single-day highest mortality

d. Then Map and table

e. Then again scatter Plot and bar plot for Bangladesh

Then the bottom section

Let’s see

There are several python functions:

1: df_move1st_sg : this will show Bangladesh on the top of the table with confirmed cases, deaths, and recovered.

2: gen_map: this will make a map of all country but it is focused on Bangladesh

3: high_cases : Functions to create a display for highest cases.

4: datatime_convert and return_outbreakdays : Convert datetime to Display datetime with the following format — 06-Apr-2020

5: draw_global_graph: this will make a global scatter plot.

6: draw_highest_10: Function to plot Highest 10 countries cases with cases and date

7: draw_singleCountry_Scatter: this will make scatter plot for Bangladesh

8: draw_singleCountry_Bar: Function to plot Single Country Bar with Scatter Plot.

first top sections of this dashboard
top affected countries
Maps and table section
Bangladesh focused plots including confirmed, deaths and recovered cases and time-related barplot
footer section, you add your credits here

[Note: to understand it clearly, you have to understand HTML, CSS, and python.]

you can access it online and deployed it.

I have attached Python [version 3.7.0] code in the GitHub repository. Please check it. Next post will be [Data analysis and visualization of digital elevation of Bangladesh and Practical Ecological data analysis ]

--

--

Hafez Ahmad

I am an Oceanographer. I am using Python, R, MATLAB, Julia, and ArcGIS for data analysis, data visualization, Machine learning, and Ocean/ climate modeling.