首页 > 解决方案 > 绘图替换 Shiny 应用程序中先前绘图的位置

问题描述

我正在使用复选框在闪亮的应用程序主面板上绘制多个图,现在因为我的图是在我取消选中第一个复选框时选中我想要的复选框后发生的,所以第二个复选框图应该替换第一个图的位置,但不要保持固定在其上位置。我正在使用 SPLITLAYOUT 在主面板上绘制多个图。

         navbarMenu("Data quality Control",
                    tabPanel("Item A"),
                    tabPanel("Item  B")),
         navbarMenu("Tools",
                    tabPanel("Item A"),
                    tabPanel("Item  B")),
         tabPanel("Calibration"),
         tabPanel("Infrared_Prediction"),



         sidebarLayout(

           sidebarPanel(

             fileInput(inputId = "fls", "Choose CSV File", multiple = F, buttonLabel = "Browse", placeholder = "No file loaded", accept = NULL),

             #tags$hr(),
             uiOutput("Raw"),
             uiOutput("SG"),
             #tags$hr(),
             uiOutput("MSC"),
             uiOutput("SNV"),
             uiOutput("SNVDetrend"),
             uiOutput("Baseline")


           ),



           mainPanel(

             fluidRow(
               splitLayout(cellWidths = c("50%", "50%"), withSpinner(plotOutput("plts")), withSpinner(plotOutput("plts1"))),
               splitLayout(cellWidths = c("50%", "50%"), withSpinner(plotOutput("plts2")), withSpinner(plotOutput("plts3"))),
               splitLayout(cellWidths = c("50%", "50%"), withSpinner(plotOutput("plts4")),  withSpinner(plotOutput("plts5")))
             )



           )) 

))

标签: rshiny

解决方案


查看 shinyjs 包,它允许您显示和隐藏带有动画的元素,这些元素可以滑动。没有可重复的例子,这是我能为你做的最好的。


推荐阅读