Tychobra / polished_example_apps

Example Apps for Polished
33 stars 19 forks source link

Flexdashboard in shiny runtime #17

Closed jayktee closed 2 years ago

jayktee commented 3 years ago

Hi! Thank you so much for these examples and the great package. I am creating a prototype dashboard for a city in California and the client would like to have authentication for this dashboard for data privacy.

My issue is similar to #16, where I have a Flexdashboard hosted on shinyapps.io. I’ve done the installation on the polished dashboard. The only difference I can tell is that my Flexdashboard is using runtime::shiny which means it cannot be knit to a static html document. In this case, what should my file structure and config look like?

GitHub repo is here and draft product is here.

Thanks in advance!

merlinoa commented 3 years ago

Hi @jayktee

Unfortunately you cannot currently use .Rmd with runtime shiny with polished. We may try to support it at some time in the future, but it is not on our current roadmap. Polished only supports regular shiny apps and static html (e.g. html produced by Rmd output: html_document).

If you want to use polished now, I suggest switching to shinydashboard, and making a regular shiny app. shinydashboard will give you a similar look to your current app, and it will allow for more flexibility in what you can build. If you need some guidance, I'd be happy to help you convert your flexdashboard to a shinydashboard.

jayktee commented 3 years ago

Hi @merlinoa, thank you so much for your prompt response. I can definitely switch to a shinydashboard format, and I appreciate your offer of support!

One quick question on the shinydashboard (which I haven't built out in a while), I've noticed that the latest Shiny documentation (example here) suggest a single-file app.R format as opposed to the ui.R and server.R formats that are in your examples. If I did follow the single-file format, would I need to make any modifications to your code for polished to work?

Without testing this out, in theory I would have a global.R and a app.R script, the global.R script being exactly the same as your global.R example, and the app.R script combining your ui.R and server.R code.

If this does not work for some reason, I will happily use your existing examples with the separated global.R, ui.R and server.R files! I just wanted to check and see if there was a simple way to switch to single-file conventions.

merlinoa commented 2 years ago

At long last, you can now use runtime shiny with rmarkdown documents including flexdashboards! Here is an example app: https://github.com/Tychobra/polished_example_apps/tree/master/09_rmarkdown