

Discover more from hrbrmstr's Daily Drop
Dashboarding has come to Quarto land! So, today we dive into that a bit and give you a choice between TWO WPE assignments (one is for folks who care not about dashboards).
Quarto Dashboards
Dashboarding has come along for the ride with Typst in the bleeding-edge zone (v1.4) of the Quarto multiverse. It's a more modern riff on the venerable flexdashboard that was/is available to folks who prefer R Markdown (turns out not everyone like Quarto…to each their own).
For those unfamiliar with this space, both ecosystems (Quarto/flexdashboard) allow you to publish a group of related data visualizations as, well, a dashboard. What makes the Quarto version of special is that you can use a wide variety of components including Observable JavaScript components, Plotly, Leaflet, Jupyter Widgets, htmlwidgets, static graphics (Matplotlib, Seaborn, ggplot2, etc.), tabular data, value boxes, and text annotations. The layout of these components is flexible and easy to specify, with intelligent resizing to fill the browser and adapt for display on mobile devices.
Unlike R Markdown, Quarto doesn't have a dependency or requirement for R. Quarto was developed to be multilingual, beginning with R, Python, Javascript, and Julia, with the idea that it will work even for languages that don’t yet exist. This makes Quarto Dashboards a more versatile tool for creating interactive dashboards, as it can cater to a wider range of users with different programming language preferences.
Quarto Dashboards can include embedded Shiny components, such as a plot with sliders that control its inputs, or even simple Shiny applications that include several components. Shiny, a package that makes it easy to build interactive web apps, can be integrated with Quarto to create dynamic and interactive dashboards.
As noted, Quarto also includes native support for Observable JS, a set of enhancements to vanilla JavaScript created by Mike Bostock (also the author of D3). Observable JS is distinguished by its reactive runtime, which is especially well suited for interactive data exploration and analysis. This allows for the creation of highly interactive and responsive dashboards.
Getting And Using The Right Quarto
Quarto v1.4+ is required to gain access to these dashboarding superpowers. While you could hit the Quarto site and do the download dance, Devin Pastoor has done us all a solid and made a golang CLI for managing multiple Quarto installations. It's documented well, so we'll be environmentally conscious and save a few bytes here.
I also highly suggest you start using a special YAML header field to indicate the version of Quarto any of your Qmd documents support. For Quarto dashboards, that would look like:
quarto-required: >=1.4
This ensures Quarto will fail with a sane and helpful error message vs. leave users who stumble across your creations wondering “what's wrong with me?”.
Your First OJS Quarto Dashboard
The Quarto documentation site is pretty dope, so I do not feel compelled to reiterate the specifics of layouts.
There are also tons of examples of using R for flexdashboard
(and that tracks to Quarto), so we're not writing a dashboard in R.
What we are doing is writing a Quarto dashboard using Observable JS code blocks and some data I gathered from work.
You can visit the starter dashboard and grab the code for it from GitLab.
Your Mission
If you don't like dashboards, the qvm
utility is using a dependency that will no longer receive support from the maintainer (survey). Fork the qvm code and replace the UI ops with BubbleTea, which we vicariously used in a previous WPE. It should be a fun and relatively quick golang hack.
For those in the dashboarding spirit, there is plenty of extra data in the JSON that comes along for the ride with the WPE. Try out some other visualizations, add some tables, re-do the layout, or even convert the whole thing to python or R.
Also, make sure to check out Jeremy Allen’s recent Quarto dashboard for more inspiration.
FIN
I'm definitely going to be finding something to hack on all weekend given the current situation in my state. Be safe out there and remember to hug someone today. ☮️