title: dynamically adjust height and/or width of shiny-plotly output based on window size
body: <p>I would like to have the shiny-plotly output height and width adjusted to the current window size. I have tried to use the below but of no use.</p>
  
  <pre><code>ShinyUi &lt;- fluidPage(
  
    # Application title
    titlePanel("title"),
  
    sidebarLayout(
      sidebarPanel(
        ... inputs ...
      ),
  
      mainPanel(
            plotlyOutput("distPlot", height = 'auto', width = 'auto')
        )
    ))
  
  ShinyServer &lt;- function(input, output, session) {
  
     output$distPlot &lt;- renderPlotly({
  
      p &lt;- ggplot(dataShow, aes(x=dataShow$X, y=dataShow$Y))  + 
  geom_point(shape=1, alpha = 0.5, color = "grey50")
  
      ggplotly(p)
  
    })
  
  }
  
  
  # Run the application 
  shinyApp(ui = ShinyUi, server = ShinyServer)
  </code></pre>
  
  <p>Would you know of any other options to use maybe in server function instead of the above UI function usage?</p>
  
  <p>Smaller Window:
  <a href="https://i.stack.imgur.com/5OREB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5OREB.png" alt="enter image description here"></a></p>
  
  <p>Expanded Window:<a href="https://i.stack.imgur.com/QIOOP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QIOOP.png" alt="enter image description here"></a></p>