Skip to content

Demonstrates how to build and deploy a dashboard for exploration of road crashes in Queensland, Australia, based on dataset obtained from the Department of Transport and Main Roads.

License

Notifications You must be signed in to change notification settings

andrewkflui/RoadCrash-Dash

Repository files navigation

Exploring Geolocation Data with Plotly Express and Dash: A Road Crashes Dashboard

Source code and Docker files for cloud deployment

This repository contains the source code and configuration files for the medium articles:

image

Requirments

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

Key Files

  • 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 dashboard
  • mapbox_access_token.txt: The access token obtained from Mapbox (for the version that uses Mapbox tiles)

The Road Crashes Data File

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.

image

Mapbox Access Token

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.

Licences

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/.

About

Demonstrates how to build and deploy a dashboard for exploration of road crashes in Queensland, Australia, based on dataset obtained from the Department of Transport and Main Roads.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published