-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
webr chunks in a document with shiny #4
Comments
What However, the Shiny app embedded in Quarto is not able to find the necessary https://quarto.org/docs/interactive/shiny/resources.html#asset-resources Please note, we need the With this being said, if you can figure out where the Shiny app is launching from, I can try and figure out how to make sure the worker files are in the correct location by default for the Feel free to explore with: ---
title: "Testing with Shiny Backend"
format: html
keep-md: true
server: shiny
filters:
- webr
---
```{r}
knitr::knit_engines$set(webr = knitr:::eng_verbatim)
```
## Webr
```{r}
rnorm(1)
```
Note, we added the `#| echo: true` remark:
```{webr}
#| echo: true
1 + 1
```
## shiny
```{r}
library(shiny)
sliderInput("bins", "Number of bins:",
min = 1, max = 50, value = 30)
plotOutput("distPlot")
```
```{r}
#| context: server
output$distPlot <- renderPlot({
x <- faithful[, 2] # Old Faithful Geyser data
bins <- seq(min(x), max(x), length.out = input$bins + 1)
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
``` |
Thanks for your response. I tried the following and it seems that it is able to find the worker files:
Then when I run quarto serve test.qmd, I can see the following messages in the javascript console:
However the Run button seems to be stuck at "Loading webR...", and I am never able to run the R code. Does this give you any clues? Could it be something in the shiny javascript code that is blocking the webR? Sorry, I am no js expert. |
I'm having some difficulty getting webr to work in a document with some shiny reactive elements, that I run with quarto serve. Here is an simple example. When I run this with quarto serve, the webr chunk is missing. If I remove the shiny stuff and run with quarto preview, the webr chunk appears as expected. I'm not seeing any error messages in the javascript console. Any ideas what might be going wrong?
The text was updated successfully, but these errors were encountered: