Global terrorism database dashboard in python by plotly dash 1

Global terrorism database dashboard in python by plotly dash
Global terrorism database dashboard in python by plotly dash

Create global terrorism database dashboard in python by plotly dash using interactive plotly data visualization library and dash web app library.

There are three charts in this global terrorism database dashboard in python by plotly dash. Scattermapbox map chart is static or it works as output. I have connected input component drop down list to combination of stack bar and line chart and pie chart. In the previous posts, you have seen that donut chart or pie chart work as output. But here it works with drop down list and data on the pie chart is changed according to the selected value from to the drop down list. Similarly, we can dynamically change data on donut chart.

Combination of line and stack bar chart displays data for each country over the period for each country death, attack and wounded values. x-axis shows year values and y-axis shows death, attack and wounded values. Scattermapbox displays data for each country on its geographic location. You need to create free account on Mapbox website to get token. This map chart need token to access geographic location using latitude and longitude values from the respective columns. You can create free account using the below link.

Note: There are 135 columns in the below data set. You can see on Kaggle website using the below link. I have created new data frame using only 10 columns from to the original data set. You can select only these 10 columns and save new csv file using pandas built in function that is to_csv. You can view below list of these 10 columns.
[‘region_txt’, ‘country_txt’, ‘provstate’, ‘city’, ‘iyear’, ‘latitude’, ‘longitude’, ‘nkill’, ‘nwound’, ‘attacktype1’]

Create free Mapbox account using below link to use token in the scattermapbox map chart.

https://account.mapbox.com/auth/signup/

Download the csv data file using the below link.

https://www.kaggle.com/START-UMD/gtd

To see full code,hover on the code area and use horizontal scrollbar if needed.


If you have any problem in learning above code, please comment in the comment box. I will help you as soon as possible.


Recommended For You

About the Author: Mubeen Ali

I am passionate about learning Dash. Dash is a python framework that creates beautiful web based data visualization dashboards.