rstudio / bslib

Tools for theming Shiny and R Markdown via Bootstrap 3, 4, or 5.
https://rstudio.github.io/bslib/
Other
490 stars 58 forks source link

Card sidebar opening causes 2nd jitter/re-alignment to plotly #1091

Open asadow opened 4 months ago

asadow commented 4 months ago

I'm making heavy use of the sidebar open/close feature and I've noticed there is a 2'nd jitter from a sidebar opening. This effect is more pronounced for my actual plot (not the reprex below), but I'm having trouble reprex'ing that.

library(bslib)
library(shiny)
library(plotly)

# -------------------------------------------------------------------------
fig <- plot_ly(z = ~volcano)
fig <- fig %>% add_surface() 

ui <- page_fluid(
  card(
    layout_sidebar(
      sidebar = sidebar(),
      plotlyOutput("plot")
    )
  )
)

# Server logic
server <- function(input, output, session) {
  output$plot <- renderPlotly({
    fig
  })
}

shinyApp(ui, server)
gadenbuie commented 4 months ago

Could you include a video from your original example? I'm having hard time finding the effect you're describing in the reprex.

asadow commented 3 months ago

sidebar