【发布时间】:2015-05-27 09:35:38
【问题描述】:
我正在编写一个应用程序,我希望侧边栏面板中的图像比我放入其中的图像大一点。随着窗口变小或变大,侧边栏也会变小或变大,但图像保持静止。我该如何解决这个问题?有没有办法获取侧边栏的长度或有更好的方法来渲染图像?
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"
))
})
})
【问题讨论】: