Closed keller-mark closed 1 month ago
The problem is that this results in the R Console hanging while the widget runs... I don't think there is a way around this.
The shiny app can be launched via rstudioapi run as background job but then the app has no way to connect to the Viewer pane.
I think the solution is to allow the user to select between multiple scenarios when running the widget:
shiny
: plain htmlwidget to embed in other Shiny apps - bidirectional communication via calls Shiny.setInputValue - re-rendered via reactive environmentstatic
: plain htmlwidget (one-way communication) - no way to send data back to R process
gadget
: shiny app in viewer pane (bidirectional communication), but the R Console will hang until the app is stopped
dynamic
: htmlwidget with background websocket server that updates the R environment on messages - may only work in localhost settings - not confident that it would work with RStudioConnect or other remote settings like HPC clusters
Should the user need to opt-in when creating the widget? Or should this be the only supported mechanism for rendering the widget? Or opt-out?
Should probably keep the plain htmlwidgets option for scenarios like widgets embedded in pkgdown sites where the widget needs to become static (no R process to run the Shiny server)