[英]How do I reinstate visibility of hidden Shiny output?
I tried this solution to suppress an error in a Shiny app:我尝试使用此解决方案来抑制 Shiny 应用程序中的错误:
tags$style(type="text/css",
".shiny-output-error { visibility: hidden; }",
".shiny-output-error:before { visibility: hidden; }"
)
How do I reverse this?我该如何扭转这一局面? Unfortunately, it is hiding my plot.
不幸的是,它隐藏了我的 plot。
Here's the full code including Bas' remedy:这是包括 Bas 的补救措施在内的完整代码:
# Objective: app that creates Markov chain diagrams based on user input
library(heemod)
library(diagram)
library(shiny)
library(shinyMatrix)
ui=shinyUI(fluidPage(
titlePanel("Markov Diagram Creator"),
fluidRow(
sidebarPanel(
textAreaInput("statenames_1",label = "Enter state names here...", value = "H, S1, S2, D"),
hr(),
tags$h4("Enter state probability transition matrix here: "),
uiOutput("matrix")
), # end of sidebarPanel
mainPanel(
hr(),
plotOutput("plot")
) # end of mainPanel
)))
server=function(input,output){
output$matrix <-renderUI({
states <- unlist( strsplit( x=input$statenames_1, split = "[[:punct:]]" ))
statenames <- list(states, states)
m <- (matrix( c(0), length( states ), length( states ), dimnames = statenames ))
m1 <- matrixInput("matrix1", rows = list( names = T, editableNames = F ), cols = list( names = T, editableNames = F ),
value = m )
m1
})
mTM_List <- reactive({
req(input$matrix1)
mTM <- as.list( ( as.numeric( t( input$matrix1 ) ) ) )
mTM$state_names <- ( as.character( rownames( input$matrix1 )))
mTM
})
output$plot <- renderPlot({
plot(do.call( define_transition, mTM_List() ) , cex=0.75, ylim = c(0,.4))
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.