Shiny plotly sizing issue for plotlyOutput() when width = 100%
まだ誰も着手していません。
- 主要言語
- R
- スター
- 2.7k
- フォーク
- 641
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
When using the default width = 100% for plotlyOutput() in Shiny apps, I always run into issues where the width doesn't scale to the full width when clicking away before the plot is fully rendered. When clicking back, the plot's width doesn't adjust or rescale. This setting occurs often in practice when designing a shinydashboard with multiple tabItems(). Minimal example and a GIF to better explain what I mean below. Posting it here, but please advise if this should be an htmlwidgets or shiny issue instead.

library(shiny)
library(plotly)
ui <- navbarPage(
title = "Minimal Example",
tabPanel("Home", HTML("Click the `Plot` tab and then rapidly back on the `Home` tab. Wait 2 seconds and then click the `Plot` tab again.")),
tabPanel("Plot", plotlyOutput("plot"))
)
server <- function(input, output) {
output$plot <- renderPlotly({
Sys.sleep(2)
plot_ly(iris, x = ~Sepal.Width, y = ~Sepal.Length, type = "scatter", mode = "markers")
})
}
shinyApp(ui, server)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供された最小限の R Shiny の例を実行し、plotlyOutput() と renderPlotly() を使ったタブ切り替え時の挙動を再現します。サイズ調整の問題が plotly.R、htmlwidgets、または Shiny のどこにあるのかを調査します。遅延してレンダリングされた場合でも、タブに戻った後にプロットが全幅に拡張されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- plotly, r
- 領域
- data-visualization, frontend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100