This project aims to visualise diabetes as death indicator and associated factors over time/across different states in the US. It uses data from the Centers for Disease Control and Prevention (CDC) and kaggle to create interactive maps and charts that allow for easy comparison and analysis of diabetes rates. Charts.js javascript library is used to visualise the bar chart showing yearly death counts for top causes of death in the US.
Landing page is deployed via https://marduo2022.github.io/Diabetes_visualisations/
Interact with this page by clicking the appropriate links to visit the Map and Chart pages.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You will need to have the following software installed on your machine:
requirements.txt
file)Clone the repository to your local machine:
git clone https://github.com/MarDuo2022/Diabetes_visualisations.git
Navigate to the project directory:
cd Diabetes_visualisations
Install the necessary dependencies:
pip install -r requirements.txt
In the browser window that opens, navigate to the project directory and open the folder code
.
Open the Jupyter Notebook: Death_counts_Chronic_indicators_PostgreSQL.ipynb
.
In this jupyter notebook, the initial csv files are imported into pandas dataframes, and cleaned by dropping irrelevant columns.
Run the cells in the notebook to load the data into local PostgreSQL database and create cleaned csv files as output.
Final visualisations can be seen from the landing page index.html
and linked sites, charts.html
and maps.html
.
Diabetes is among the top 10 causes of death in the US. Distribution of diabetes is associated with factors such as distribution of fast food restaurants.
code
folder contains all coding at the back-end:
Database extraction into csv files and loading into PostgreSQL database is in the Jupyter notebook Death_counts_Chronic_indicators_PostgreSQL.ipynb
.
Code for plotting charts is in plot.js inside 'js' folder.
Code for visualising maps is in Merging_Data_maps.ipynb and Restarants_heatmap.ipynb
data
folder contains csv files, including original csv files downloaded from data sources (such as the raw 1. Monthly_Counts_of_Deaths_by_Select_Causes__2014-2019.csv
) and the cleaned csv (such as the Yearly_death_counts.csv
).
database
folder contains schema for diabetes PostgreSQL database, which is to be created locally.
the landing page index.html
is to be deployed directly from [https://marduo2022.github.io/Diabetes_visualisations/], and there are links on this page to go to the charts.html
and maps.html
pages.
the maps are in the Population_vs_Obesity.html
and Restaurants_vs_Diabeties.html
on the homepage.