quarto-dev / quarto-dev/quarto-cli

shiny::downloadButton not appearing in Quarto Shiny document

Offen
#999 3 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug shiny third-party
Vorherrschende Sprache
JavaScript
Sterne
6k
Forks
458
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
41

Beschreibung

I'm having an issue getting shiny::downloadButton to appear in a shiny document through Quarto. I can get shiny::downloadLink to correctly appear and download data as expected.

I am on:

  • Quarto version 0.9.464
  • RStudio 2022.02.1+461 "Prairie Trillium" Release (8aaa5d470dd82d615130dbf663ace5c7992d48e3, 2022-03-17) for Windows
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36
  • R version 4.1.3 (2022-03-10)

I tested this with a new Quarto Shiny presentation, with only minor additions. This version has downloadButton, which doesn't work, but changing it to downloadLink works as expected:

---
title: "Test"
format: html
server: shiny
---

## Shiny Documents

This Quarto document is made interactive using Shiny. Interactive documents allow readers to modify parameters and see the results immediately. Learn more about Shiny interactive documents at <https://quarto.org/docs/interactive/shiny/>.

## Inputs and Outputs

You can embed Shiny inputs and outputs in your document. Outputs are automatically updated whenever inputs change. This demonstrates how a standard R plot can be made interactive:

```{r}
sliderInput("bins", "Number of bins:", 
            min = 1, max = 50, value = 30)
plotOutput("distPlot")
downloadButton(outputId = 'faithfulData')
```

```{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')
})

output$faithfulData <-
  downloadHandler(
    filename = function() {
      paste0('data.csv')
    },
    content = function(file) {
      write.csv(
        x = faithful,
        file = file
        )
    }
  )
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Render the minimal Quarto Shiny document from the issue and compare the behavior of downloadButton with downloadLink. Start by tracing how the Shiny document handles the downloadButton example, then verify that the button appears and that its download handler works as expected.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
r
Bereich
frontend, web-dev
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.