【发布时间】:2019-10-26 19:39:14
【问题描述】:
我一直在寻找并尝试使 wellPanel 具有闪亮的动态,但没有任何乐趣。动态我的意思是它们应该只在它们将包含的对象被创建而不是之前出现。
下面是一些可重现的代码来说明问题。您会看到,即使在显示任何绘图之前,wellPanel 和标题也已显示。这里的标题只是一个 helpText,我可以使这个反应,但不是 wellPanel。老实说,这不会影响应用程序的功能,但它并不漂亮,让我发疯。
library(shiny)
ui<- shinyUI(fluidPage(
titlePanel("My example shiny"),
fluidRow(
column(3, wellPanel(
numericInput("n", "N:", min = 0, max = 100, value = 50),
actionButton("goButton", "Go!")
)),
column(6,
wellPanel(
plotOutput("plot1", width = 400, height = 300),
helpText("Caption: This text should appear at the same time as the plot and well"),
#verbatimTextOutput("text")
)
)
)
)
)
server <- function(input, output) {
plot1 <- eventReactive(input$goButton, {
hist(rnorm(input$n))
})
output$plot1 <- renderPlot({
plot1()
})
}
shinyApp(ui = ui, server = server)
该应用程序将有多个 wellPanel,最好不要让初始显示充满空面板,否则会让人觉得有些地方不对劲。
任何指针都将受到高度赞赏。 干杯
【问题讨论】: