quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.92k stars 324 forks source link

Including Shiny Gadgets in a Quarto Page #4437

Closed ralmond closed 1 year ago

ralmond commented 1 year ago

I've created a gadget for editing probability distributions.

This seems to work in inside of a Rmarkdown document.

gadget <- MakeRegressionGadget(node)
shiny::shinyApp(gadget$ui,gadget$server,options(height=2000))

However, I'm trying to move this into a qmd document. Here is my attempt:

#| context: server
gadget1 <- MakeRegressionGadget(node)
shiny::shinyApp(gadget1$ui,gadget1$server,options(height=2000))

Where node is defined in a bunch of code run in context setup.

In the quarto version my code isn't rendering, and I'm wondering what I'm missing.

I suppose I could try running the function in gadget$ui() in a render context; however, then I don't know what to do with gadget1$server() which is a three argument function.

Source code for the gadgets is at https://github.com/ralmond/Peanut/R/shinyNode.R if you are curious.

cscheid commented 1 year ago

Can you share a full, single .qmd that causes this issue (or multiple files in a repro if needed?).

cscheid commented 1 year ago

Hi, I'm going to go ahead and close this issue since I haven't heard back from you. If you can provide a single a full, single .qmd that causes this issue (or multiple files in a repro if needed), we'll be happy to reopen.