Chart width error with shiny tabpanels
まだ誰も着手していません。
- 主要言語
- R
- スター
- 2.7k
- フォーク
- 641
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
付属の最小限の Shiny アプリから始め、renderPlotly が完了する前に tabsetPanel のタブを切り替えて問題を再現します。タブが再び表示されたときに plotlyOutput のサイズがどのように処理されるかを追跡します。完了条件は、最初のタブに戻った後に両方のプロットが正しい幅を再取得し、遅延レンダリングのシーケンスに対する回帰テストがあることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- r
- 領域
- data-visualization, frontend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100