Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Quarto Shiny dashboards #11

Closed
bisacciamd opened this issue Mar 18, 2024 · 3 comments
Closed

Support for Quarto Shiny dashboards #11

bisacciamd opened this issue Mar 18, 2024 · 3 comments
Labels
question Further information is requested

Comments

@bisacciamd
Copy link

In recent months there's been significant development in Quarto Dashboards, and Shinylive integration in Quarto. However, at present, it is not possible to integrate Shinylive specifically within a Quarto Dashboard running a Shiny application.

As Quarto dashboards use a somewhat similar structure to standard Shiny apps, I think integration of this feature in Shinylive would be feasible & extend Shinylive applicability and use cases.

@coatless
Copy link
Contributor

coatless commented Mar 21, 2024

Note

Some background for the googler, this is related to a question @bisacciamd asked on StackOverflow and ended up in my inbox, which was redirected here. The relevant SO question:

A way for shinylive integration for serverless Quarto R Dashboard?
https://stackoverflow.com/q/78073680/20898996?sem=2

@bisacciamd This repository is related to a tutorial using Shinylive within Quarto. The issue ticket you typed up is more of a feature request for the Shinylive for R project. I would suggest placing the request at either:

In the interim, I probably would encourage you to set up a Shiny App that uses the {bslib} library to deliver a shiny dashboard:

https://rstudio.github.io/bslib/articles/dashboards/index.html

For instance, consider the following myapp/app.R:

library(shiny)
library(bslib)

ui <- page_sidebar(
  title = "My dashboard",
  sidebar = "Sidebar",
  "Main content area"
)

server <- function(input, output) {
  # code here
}

shinyApp(ui, server)

This would allow you to then directly convert the shiny app to shinylive via:

# Install shinylive from CRAN
install.packages("shinylive")

# Convert the shiny app in `myapp` to a shinylive app available in `site/`
shinylive::export("myapp", "site")

# Check locally the dashboard
httpuv::runStaticServer("site/")

Publish the site/ files on GitHub pages to fully get a working app. I'll probably throw together a quick deployment guide based on the above skeleton later tonight.

@coatless coatless added the question Further information is requested label Mar 21, 2024
@coatless
Copy link
Contributor

@bisacciamd sorry for the delay; it's been hectic.

So, I've ported over the example Earthquake dashboard that Quarto Dashboard used to a Shiny Dashboard powered by bslib. From there, I've converted it into an r shinylive dashboard app.

You can see the repository over here:

https://github.com/coatless-tutorials/r-shinylive-dashboard-app

The app should appear here (warning, large file size on mobile):

https://tutorials.thecoatlessprofessor.com/r-shinylive-dashboard-app/

@bisacciamd
Copy link
Author

Wow - thank you very much @coatless, this is impressive — I'll look into it and try my luck.

BW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants