This is a dashboard for EECA's Energy End-Use Database, built with Quarto and Shiny for Python. Quarto provides the dashboard's document structure and layout, and Shiny provides the dashboard's interactivity. This dashboard is deployed as an interactive application to EECA's shinyapps.io space.
Live Production Dashboard Live Development Dashboard
There are two things you will need to run the dashboard: Quarto and Python. This readme will assume the latter is already installed through Anaconda.
Install the Quarto CLI tool from the Quarto website: https://quarto.org/docs/download/. This dashboard requires only v1.4.x, the first Quarto release to include dashboard functionality. At the time of writing, v1.4.x is no longer in pre-release.
At the time of writing, shinyapps.io only supports python 3.7.13, 3.8.13, 3.9.13. If an application is deployed using another version of python, shinyapps.io will attempt to run it on the closest major/minor version of python. For this reason, a Python 3.9.x virtual environment is used in the development of this dashboard.
conda create -n eeud python=3.9
and activate it conda activate eeud
.python -m pip install -r requirements.txt
.quarto render index.qmd
. In this instance, quarto
runs the CLI tool we installed earlier.shiny run app.py
. In this instance, shiny
executes a runtime package that is part of our Python environment, installed from our requirements.Deployment to shinyapps.io is done via Github actions.
Dev: deployment occurs on any push to main
branch.
Prod: deployment occurs on any release tag that matches the pattern v*.*.*
.
A user with access to EECA's shinyapps.io portal and the settings for this repo can update the Github secrets as needed.
See the instructions on this Posit docs page to get rsconnect
token information.
Easiest way to is to build and then deploy manually
rsconnect deploy shiny . -n "ACCOUNT NAME HERE" -t "APPLICATION NAME HERE" -N
In the testing of deployment of this dashboard, a number of difficulties were encountered that may also be encountered by others attempting to run this dashboard.
shiny
or rsconnect
may sometimes not work due to "access denied" permission complications. The cause of this has not been entirely ascertained, as the occurence of this complication has been inconsistent. Try and rerun the action manually to resolve this.pip freeze
was used to create the requirements.txt, however this created problems for shinyapps' virtual environment. After removing version restrictions from the list of packages as initially included by freezing proved more successful, however shinyapps's environment defaulted to installing a few packages with older versions than was required by the dashboard (notably the shiny
and shinywidgets
packages). Restoring version restrictions to just these necessary packages allowed for a successful deployment.Quarto Dashboard docs: https://quarto.org/docs/dashboards/
Shiny for Python docs: https://shiny.posit.co/py/api/core/