quarto-dev / quarto-dev/quarto-cli
Guide for migrating Quarto Dashboard layout/formatting to Shiny Express
Open
@cwickham is already working on this.
Since Apr 24, 2024.
documentation
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
What would you like to do?
Give feedback or suggest an improvement
Description
@cwickham Here's the outline I had for people who are trying to port from Quarto Dashboard to Shiny Express.
- Overview
- Why you might need to go from Quarto Dashboard to Shiny Express
- Structure
- Cards and code chunks
- Quarto: code chunk is card, or alternatively,
::: {.card} - Shiny:
ui.card() - Card titles
- Quarto:
#| title - Shiny:
ui.card_header
- Quarto:
- Card padding
- Quarto:
#| padding: 0px - Shiny: not sure…
ui.card(style = "--bs-card-spacer-y: 0; --bs-card-spacer-x: 0;")works but can’t be the best way.
- Quarto:
- Expandable
- Quarto:
#| expandable: false - Shiny: argument on ui.card:
full_screen: True/False
- Quarto:
- Quarto: code chunk is card, or alternatively,
- Rows and columns
- Quarto: H2 headers provide structure
- Shiny: structure is provided by
ui.layout_columns - Column-major orientation is well supported in Quarto, not as well supported in Shiny
- Fill/flow is fillable/fill
- Multi-page layouts
- Quarto: H1 headers
- Shiny Express:
ui.nav_panel - Shiny Core:
ui.page_navbar
- Tabs
- Quarto:
{.navset} - Shiny:
ui.navset_card_tabs
- Quarto:
- Sidebars
- Global
- Quarto:
# {.sidebar} - Shiny:
ui.sidebar
- Quarto:
- Page-level
- Quarto:
## {.sidebar} - Shiny:
ui.nav_panel+ui.layout_sidebar
- Quarto:
- Card-level
- Quarto:
#| content: card-sidebar - Shiny:
ui.card/ui.layout_sidebar
https://shiny.posit.co/py/layouts/sidebars/#sidebar-within-a-card
- Quarto:
- Global
- Toolbars
- Quarto:
{.toolbar} - Shiny: TBD
- Quarto:
- Cards and code chunks
- Data display
- Plots: switch to
@render.plotif not already - Tables: switch to
@render.data_frameor@render_widgetif not already - Value boxes:
ui.value_box - Dynamic content: f-strings or, if reactive,
@render.express
- Plots: switch to
- Text/paragraph formatting
- Use
ui.markdown()for continuous blocks of Markdown - For finer grained control, need to use HTML tags:
ui.tags.strong(...), etc.
- Use
- Theming
- TBD (brand.yml)
- Static assets
- Quarto: foo_files/ subdir
- Shiny: put files in
./www/directory--but don't include "www" in the URL path, e.g.www/logo.pngwould be<img src="logo.png">
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.