The-Strategy-Unit/data_science

[Blog?] Add notes on Quarto dashboard

Closed this issue · 1 comments

From C&C 2024-03

Why do I like dashboards

  • Easy to create
  • Shareable without a server

I used to train public health analysts
They did great work and wanted to share it with people
Blockers were

  • time to learn shiny
  • infrastructure for hosting
  • data privacy issues

Why do I like Quarto?

  • Working together
  • Readable
  • Mulit-language

Quarto dashboards

  • Interactive, language agnostic dashboard
  • Replaces {flexdashboard} for R Markdown
  • Also works with {shiny}

:::{.aside}
Dashboards were release in Quarto v1.4
:::

Who cares about Shiny?

  • Complex to learn
    • Difficult to debug
  • Have to have a server to deploy
  • A bugger to deploy

Main components

  • Cards

    • Plots
    • Tables
    • Text
    • Value boxes
  • Structure

    • Rows
    • Columns
    • Sidebars
  • Layout

    • Pages
    • Navbar

::: {.notes}

  • One card,
  • Another card
  • Add titles on the cards (#| title:)
  • Arrange with headings (dashboard: orientation:)
  • Make a row with Head ## Row then column with ### Column
  • {.tabset}
  • Page
  • row and heigh width / height
  • Code cells automatically make cards
  • sidebars can be within a page or global
  • nav-buttons: github / twitter
  • logo
  • In addition to cards you can add value boxes #| component: valuebox
  • cards are expandable (by default)
    :::

bslib

layouts
laout_columns
accordions
tooltip / popover
taskbutton
darkmode

Shiny isn't always the answer

  • Shiny vs Static Quarto

  • Hosting: Must be hosted with a live R server (or shinylive) - Just a HTML file - can send to anyone :D

  • Skill level: Little harder - Low barrier to entry

  • Requires a live connection

Deployment

  • Static HTML website (rendered once)
  • Schdeduled (Cron job)
  • Parameterised (Connect)
  • Fully interactive (SHINY)

What's in a widget?

  • HTML widgets are simply

  • {leaflet}

  • {plotly}

  • {DT}

  • animation / plotly?

# Example leaflet map

::: {.aside}
You can even make your own
:::

Other neat things

  • You can turn ipynb into a dashboard
  • Parameterisation

How interactive?

  • Static one-off
  • Regular automated reports
  • Parameterisation
  • Shiny

TLDR;

  • Quarto dashboards are
  • You can share and automate

Resources

This session was more chatty - so no slides or blog to share