简体   繁体   English

如何恢复隐藏的 Shiny output 的可见性?

[英]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.

相关问题 如何根据计算结果在 Shiny 中显示文本 output? - How do I display text output in Shiny depending on the result of a caluclation? 如何在R-Shiny输出中产生部分图形? - How do I produce partial graphics in R-Shiny output? 如何在R Shiny中将insertUI()输出添加到renderText()输出? - How do I add insertUI() output to renderText() ouput in R Shiny? 如何在 renderUI R Shiny 中观察模块 output - How do I observe module output inside renderUI R Shiny 使用隐藏的 output 启动 shiny,可以通过切换显示 - Start shiny with a hidden output that can be shown with toggle 如何根据滑块输入值的增量为R Shiny绘图的输出设置动画? - How do I animate my R Shiny plot's output based on the increments of slider input value? 如何在R Shiny应用程序中对许多输出变量的输入变量执行相同的计算? - How do I perform the same calculation on an input variable for many output variables in an R shiny app? 在 R Shiny 中,如何使用操作按钮更改主面板中的输出? - In R Shiny how do I use an Action Button to change the output in the main panel? 如何从shinyapp中查询网站URL并在shiny中显示网页output - How do I query a website URL from within shinyapp and display the webpage output in shiny 如何在 output plot 中写入传递给 shiny 应用程序的 object 的名称 - How do I write the name of an object passed to a shiny app in the output plot
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM