仅在navbarMenu及其各自的所属选项卡中显示选择输入

时间:2017-10-29 09:44:15

标签: r navbar shiny shinydashboard

我正在开发一个闪亮的应用程序,其中我第一次尝试使用navbarPage。之前我曾经使用侧边栏和主面板方法进行编码,但这看起来很简单。此导航栏提供了一个网站Look to the Application。

我无法根据需要在适当的标签中控制输入。这样的场景是这样的,在图像Select io中可以看到在我需要输入的每个选项卡中显示。 Select io只应显示在Anomaly标签中。

Shiny navbarPage Interface

    shinyUI(fluidPage(theme = shinytheme("spacelab"),
                  tags$head(includeScript("googleanalytics.js")),

          navbarPage(p(strong(code("IOT Analytics"))),


                   tabPanel("Introduction",tags$br(),

                            p(strong(code("Brief About the Approach")))

                   ) ,
                   # First Navigation-Tab Panel 

                   tabPanel("Data-Glimpse",tags$br(),
                            # Application title
                            #titlePanel("Classification of Heart Disease w/KNN"),


                            p(strong(code("Data Overview"))),
                                DT::dataTableOutput('Raw_Data')

                            ) ,

                   # Second navigation-Tab Panel

                   tabPanel("Data-Summary",tags$br(),

                            p(strong(code("Dimension"))),
                            verbatimTextOutput("dim"),
                            p(strong(code("Summary"))),
                            verbatimTextOutput("sum")
                            ),
                   # Third navigation-Tab Panel (select io should only displayed in Anomaly Detection Tab)
                   navbarMenu("Anomaly Detection",


                                 column(4,uiOutput("selt1"))
                               ,

                              tabPanel("Visualisation",
                                       tags$br(),
                                       plotlyOutput("plot1", height = "600px")

                                       ),

                              tabPanel("Anomaly-01",
                                       # fluidRow(
                                       #   column(4,uiOutput("selt1"))
                                       # ),
                                       tags$br(),
                                       dataTableOutput("temp")
                                       ,value = "T4_2"),
                              tabPanel("Error Insight", tags$br()

                                       )




                              ),
                   tabPanel("About",tags$br()) 
  #---------------------------------------------End              

)))

1 个答案:

答案 0 :(得分:2)

尝试类似

的事情
conditionalPanel

基本上为id

中的标签添加navbarPage#include <stdio.h> #include <stdlib.h> #include <signal.h> #include <unistd.h> #include <pthread.h> #include <stdbool.h> static bool shutdown; static bool thread_finished; pthread_t thread; void *thread_func(void *ptr) { while (!shutdown) { int countdown = 5; while (!shutdown && countdown--) { usleep(250 * 1000); } printf("Still waiting...\n"); } printf("Shutdown signal flag set. Closing."); thread_finished = true; return 0; } void sigint_handler(int sig) { if (sig == SIGINT) { // handle shutdown // If you need to bypass then do it here printf("Sending shutdown signal to thread\n"); shutdown = true; pthread_join(thread, NULL); } } int main() { signal(SIGINT, sigint_handler); printf("Starting background thread!\n"); shutdown = false; thread_finished = false; pthread_create(&thread, NULL, &thread_func, (void*)0); while (!shutdown && !thread_finished) { usleep(1500 * 1000); printf("Still running from main\n"); } return 0; }