我正在编写一个应用程序,希望侧边栏面板中的图像比我放在其中的图像大一点。随着窗口的缩小或扩大,侧边栏也会相应变化,但是图像保持不变。我该如何解决这个问题?是否有一种方法可以获得侧边栏长度,或者有更好的呈现图像的方法?
ui.R
library(shiny)
shinyUI(bootstrapPage(
# Application title
titlePanel("Sidebar Image App"),
sidebarPanel(
imageOutput("image", height = "auto")
)
))
服务器.R
library(shiny)
shinyServer(function(input, output, session) {
output$image <- renderImage({
return(list(
src = "one.png",
contentType = "image/png",
height = 185,
alt = "Face"
))
})
})