Dashboards
Essentially an data-driven web page.
On an interactive dashboard page, you may have opportunities to
Or, the content may be static.
Despite origins in 1970s-1980s business, popularity of dashboards (and tools) has grown dramatically in recent years.
Public health dashboards during the peak of the COVID-pandemic made dashboards quite common.
The only real “downside” of this is that,
Dashboards can be made with a variety of tools, including
as well as a variety of other tools or interfaces (e.g., datawrapper) developed by technology start-ups or open-source groups.
Explore the following (or other) dashboards:
Do you notice similarities, differences, problems, …?
Dashboards can be prepared with a variety of language/tool combinations. By using format: dashboard
in the .qmd
header, you can run code written in R, python, or Observable JS.
Computational language is specified in code blocks and languages can use a variety of interactive components:
Styling dashboard with themes is pretty easy. See https://bootswatch.com/ for a gallery of choices.
You can create a free https://shinyapps.io account to run a limited number of apps.
With a little configuration (connecting your RStudio installation to your account on the website via authentication tokens) you can begin publishing by hitting the “Publish the application or document” button or with command-line tools.
Using Shiny-based interactivity is generally much more flexible and capable than client-only interactivity, however requires a server for deployment.
Standalone shiny web apps can be written using a .app
extension and be
Anything we have done so far can be “plugged in” to a dashboard,
These can be made with or without Quarto.
We will look at three Quarto dashboards.
Laying out content is relatively simple.
#
heading identifies a named dashboard page tab.##
heading identifies an unnamed dashboard row or column.###
heading identifies an unnamed row or column (within columns or rows, respectively).The default organization is row-by-row, we will begin to experiment now.
You are welcome to use your own installation, but are encouraged to try Buddy.
Use the template .zip
file to experiment with the dashboard page layouts in static-dashboard.qmd
.
Experiment with ## Row
, ## Column
, and the size parameters.
You may need to paste the url from the “Background Jobs” tab into your browser if you get a 404 error.
Since the purpose of a dashboard is to allow for interactive data visualization and exploration, using real data is the obvious next step.
Data can be loaded locally or drawn from websites.
Experiment with static-dashboard2.qmd
(from the unzipped directory). You could
ggplot()
(from the ggplot2
package), orAdapt the following code to add a relevant “valuebox”. Remove #| eval: false
and replace each ...
with relevant content.
icon
can be found by visiting https://icons.getbootstrap.com/.color
(aliases) include: primary
, secondary
, success
, info
, warning
, danger
, light
, and dark
.value
should be the result of some earlier calculation.You can load online data into your dashboard by putting the using the url()
command with any read*()
function and its necessary options.
Paste a direct link to a .csv
file into url()
, with quotes around the name.
For example,
Finally, experiment with shiny-dashboard.qmd
(from the unzipped directory). You could experiment by
Initially I struggled to get consistent coloring of the points in the iNaturalist dashboard.
After lots of searching I found a solution that worked reliably.
Adding + lims(color = levels(dat$common_name))
to the graph ensured that the names printed, and consistently-colored points were added as the checkboxes were checked.
Comment out, or remove, that line and watch what happens. It’s quite irritating if you look closely.
Though mere mention will have to do for now, concerns about dashboard design include the
The code above should allow the user to upload a file, but you might contemplate why they might want or need to do so.
Deployment refers to the publishing of the dashboard.
When you attempt to publish (from the rendered app window), you will be prompted with instructions that are surprisingly clear.
Remember that there are a variety of other tools, specifically proprietary tools that you might encounter in the workforce.
Our approach makes the best use of our work done to date, but you may explore student or trial versions of software and try, as a hobby on your own time, to replicate some of our class tasks with other tools.