如何更新plotOutput ui对象的大小

Joh*_*non 1 r shiny

我试图调整一个plotOutputui对象的光泽

library(shiny)

ui <- fluidPage(
  fluidRow(
        column(6, numericInput('save.height', "Save height (mm)", value = 50)),
        column(6, numericInput('save.width', "Save width (mm)", value = 43))),
  plotOutput('plot_display', width = '50mm', height = '43mm'))

server <- function(input, output) {
  output$plot_display <- renderPlot({

    ggplot(iris, aes(x = Species, y = Petal.Length)) +
      stat_summary(geom = 'bar', fun.y = mean) +
      geom_point() +
      theme(aspect.ratio = 1)

  })


}

shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)

我无法找到相当于updateNumericInput()动态更新值的东西plotOutput

Big*_*ist 5

你也可以使用很棒的shinyjqui包:

library(shiny)
library(shinyjqui)

shinyApp(
  ui = fluidPage(
          jqui_resizabled(plotOutput('hist'))
  ), 
  server = function(input, output) {
    output$hist <- renderPlot({
      hist(rnorm(100))
    })
  }
)
Run Code Online (Sandbox Code Playgroud)

见这里:https://github.com/Yang-Tang/shinyjqui. 在此输入图像描述