-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
Shiny in xaringan #204
Comments
Shiny currently doesn't work in xaringan presentations (slide 20 of xaringan intro). The current recommendation is to launch the app in a new browser tab, which isn't burdensome because you'll be presenting from a browser anyway.
If you really really want your Shiny app inside your slides, you can try embedding the app inside an |
Ah thanks! I remember seeing a note about shiny in xaringan somewhere and couldn't recall where. What do you mean by "launch the app in a new browser"? By embedding in
because that doesn't work. I also tried
Doesn't work either. I am probably using it incorrectly. |
I do agree that having live shiny widgets in a presentation is generally not desirable. Unless... the presentation itself is about shiny apps :) which is my situation. |
Okay, so rather than trying to build the Shiny app in the same document as your slides, the recommendation would be to build and deploy your app separately. For example, you could deploy your app on shinyapps.io. Then you can either open a link to your Shiny app in a separate tab, or you could use Let's say your app is deployed at
or to embed the app you would use
You can add CSS styles to the |
Right. That makes sense. Thanks! |
As an expression of interest, embedding shiny apps in xaringan would be really useful to my work. |
@QuinnAsena I tried a couple of years ago, but it was too challenging and now I don't remember what the challenges were. |
Hi, I am having a related issue.
but the lazy loading is not working, it is always loading every iframe when opening the slides. I need to get the url only when the current slide is being open. thanks! |
It seems that lazy loading of iframes doesn’t work for hidden iframes. |
If it is any help, I reversed things and put xaringan in Shiny (tab 4): |
@QuinnAsena thanks for your recommendation, however, I need Shiny in slides 😬 @gadenbuie , so xaringan hides all non-showing slides? In other words, it wont be possible to get what I want? 😂 thanks for such fast replies!! |
@QuinnAsena Thanks for the example, but that is just a PDF in shiny and not really an interactive xaringan presentation. |
@jcrodriguez1989 yes exactly. I should have mentioned it in my reply; all of the slides except for the current slide have |
@royfrancis Oh yes, that's true. It should be possible to embed the interactive presentation though right (iframe?, includehtml?)? Can't quite remember why I chose PDF, maybe ran into some issue or just decided students would prefer PDF format. |
thanks for your reply @gadenbuie ! |
Do shiny widgets and shiny apps work inside a xaringan presentation?
Here is a sample document I am testing. This code in an RMarkdown document
run using
rmarkdown::run("shiny-test.Rmd")
opens up a browser and works as expected.Replacing
html_document
withxaringan::moon_reader
does not work.The text was updated successfully, but these errors were encountered: