This repository contains the source code and configuration files for the medium articles:
- Explore Geolocation Data with Plotly Express and Dash: A Road Crashes Dashboard
- Dockerize and Deploy a Python Dash Application easily with AWS Elastic Beanstalk
- Build, store and run Docker image of a Python Dash Application with Google Cloud Platform
Tested with these versions but older versions may work.
- Python 3.7 or above
- Pandas 1.1.5
- Plotly 5.13.0
- Dash 2.8.1
- Dash Bootstrap Component 1.3.1
roadcrash_qld.ipynb
: Jupyter notebook for executing the standalone Plotly Express Interactive Map (Without Dash)app.py
: The dashboard web application (using default OSM tiles)app_mapbox.py
: The dashboard web application (using Mapbox tiles)Dockerfile
: The Docker container configuration file for cloud deployment of the dashboardmapbox_access_token.txt
: The access token obtained from Mapbox (for the version that uses Mapbox tiles)
The application requires the Road Crashes CSV file (crash_data_queensland_1_crash_locations.csv
), which can be downloaded from the Open Data Portal of the Queensland Government, Australia.
The file should be placed under the folder data
in the root folder.
A mapbox access token is required for running app_mapbox.py
, which uses Mapbox tiles as specified with the statement.
fig.update_layout(mapbox_style="dark", mapbox_accesstoken=mapbox_access_token)
You may change the style from the dark theme to other available themes.
Please visit https://www.mapbox.com/ to create an account, obtain an access token, and store the token in the file mapbox_access_token.txt
.
Copyright (C) 2023 - Andrew Kwok-Fai Lui
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/.