Chart width error with shiny tabpanels
Personne n'a encore pris cette issue.
- Langage dominant
- R
- Étoiles
- 2.7k
- Forks
- 641
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Hello,
When a plot is loading and at that moment you changes the tabpanel. When you return to the initial tab panel the width of the graph is incorrect.
We have tried all kinds of solutions such as putting the plots inside a column. But nothing works to fix the problem.
Using the following code, when starting the application and you changes to "Hello 2" before the graph of "Hello 1" has been rendered. The graph of "Hello 1" looks like in the following image

and not as in "Hello 2"

library(shiny)
`ui <- fluidPage(
selectInput("choice", "Choose", choices = names(iris), selected = NULL),
tabsetPanel(id="tabset",
tabPanel("Hello 1",value = "C1",
plotlyOutput("case1")),
tabPanel("Hello 2",value = "C2",
plotlyOutput("case2")) ))
server <- function(input, output) {
output$case1 <- renderPlotly({
Sys.sleep(5)
plot_ly(iris, x = ~get(input$choice), y = ~Sepal.Length, type = 'scatter', mode = 'markers')
})
output$case2 <- renderPlotly({
Sys.sleep(5)
plot_ly(iris, x = ~get(input$choice), y = ~Sepal.Length, type = 'scatter', mode = 'markers')
})
}
shinyApp(ui = ui, server = server)
`
Thanks.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez avec l’application Shiny minimale fournie et reproduisez le problème en changeant d’onglet dans tabsetPanel avant la fin de renderPlotly. Suivez la manière dont le dimensionnement de plotlyOutput est géré lorsque l’onglet redevient visible ; le travail est terminé lorsque les deux graphiques retrouvent la largeur correcte après le retour à l’onglet initial, avec un test de régression pour la séquence de rendu différé.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- r
- Domaine
- data-visualization, frontend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100