मेरे पास 3 अलग-अलग टैब, एक साइडबार और दायां साइडबार के साथ नीचे चमकदार ऐप है। मैं चाहता हूं कि हर बार जब मैं अलग-अलग विजेट्स को बदलने और प्रदर्शित करने के लिए दो साइडबार की सामग्री को दूसरे टैब पर ले जाऊं। कमिटेड-आउट लाइनों में आप विभिन्न विजेट्स देख सकते हैं जिन्हें मैं प्रदर्शित करना चाहता हूं।

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(shiny)


shinyApp(
  ui = tags$body(class="skin-blue sidebar-mini control-sidebar-open",dashboardPage(
    options = list(sidebarExpandOnHover = TRUE),
    header = dashboardHeader(title = "Investment Advisor Monitoring - Insider Trading",titleWidth = 450),
    
    sidebar = dashboardSidebar(minified = F, collapsed = F,
                               h4("Investment Selected"),
                               textInput("StockTicker", "Enter Stock Symbol", value = "NFLX")
                               #textInput("StockTicker2", "Enter Stock Symbol 2", value = "NFLX")
                               #textInput("StockTicker3", "Enter Stock Symbol 3", value = "NFLX")
                               
                               ),
    body = dashboardBody(
      h3('Results'),
      tabsetPanel(
        tabPanel("Insider Training"),
        tabPanel("Switching"),
        tabPanel("Tax Loss Harvesting")
        
      )
      
    ),
    controlbar = dashboardControlbar(width = 300,
                                     h4("Insider Trading Parameters"),              
                                     
                                     
                                     selectInput("InsiderTradingModel", "Insider Trading Model",
                                                 c("Dynamic" = "Dynamic",
                                                   "AI based" = "AIbased"))
                                     #selectInput("InsiderTradingModel2", "Insider Trading Model 2",
                                      #           c("Dynamic" = "Dynamic",
                                       #            "AI based" = "AIbased"))
                                     #selectInput("InsiderTradingModel3", "Insider Trading Model 3",
                                     #           c("Dynamic" = "Dynamic",
                                     #            "AI based" = "AIbased"))
    ),
    title = "DashboardPage"
  )),
  server = function(input, output) { 
    
  }
)
0
firmo23 28 अक्टूबर 2021, 19:32

1 उत्तर

सबसे बढ़िया उत्तर

शायद आप कुछ इस तरह की तलाश में हैं

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)

shinyApp(
  ui = tags$body(class="skin-blue sidebar-mini control-sidebar-open",dashboardPage(
    options = list(sidebarExpandOnHover = TRUE),
    header = dashboardHeader(title = "Investment Advisor Monitoring - Insider Trading",titleWidth = 450),
    
    sidebar = dashboardSidebar(minified = F, collapsed = F,
                               h4("Investment Selected"),
                               uiOutput("mytab11"), uiOutput("mytab12")
                               
                               #textInput("StockTicker3", "Enter Stock Symbol 3", value = "AMZN")
    ),
    body = dashboardBody(
      h3('Results'),
      tabsetPanel(id = "tabs",
        tabPanel("InsiderTraining"),
        tabPanel("Switching"),
        tabPanel("Tax Loss Harvesting")
      )
    ),
    controlbar = dashboardControlbar(width = 300,
                                     h4("Insider Trading Parameters"),              
                                     uiOutput("mytab21"), uiOutput("mytab22")
                                     
                                     #selectInput("InsiderTradingModel3", "Insider Trading Model 3",
                                     #           c("Dynamic" = "Dynamic",
                                     #            "AI based" = "AIbased"))
    ),
    title = "DashboardPage"
  )),
  server = function(input, output) { 
    
    output$mytab11 <- renderUI({
      tagList(
        conditionalPanel(condition = 'input.tabs=="InsiderTraining"',
                         textInput("StockTicker", "Enter Stock Symbol", value = "NFLX"),
                         sliderInput('periods','Periods',min=1,max=120,value=60),
                         selectInput("mtvar", "Choose a variable", choices = colnames(mtcars))
        ))
    })
    output$mytab12 <- renderUI({
      tagList(
        conditionalPanel(condition = 'input.tabs=="Switching"',
                         textInput("StockTicker2", "Enter Stock Symbol", value = "APPL"),
                         selectInput("cvar", "Choose a variable", choices = colnames(cars))
        ))
    })      
    
    output$mytab21 <- renderUI({
      tagList(
        conditionalPanel(condition = 'input.tabs=="InsiderTraining"',
                         selectInput("InsiderTradingModel", "Insider Trading Model",
                                     c("Dynamic" = "Dynamic",
                                       "AI based" = "AIbased")),
                         #textInput("StockTicker", "Enter Stock Symbol", value = "NFLX"),
                         selectInput("ivar", "Choose a variable", choices = colnames(iris))
        ))
    })
    output$mytab22 <- renderUI({
      tagList(
        conditionalPanel(condition = 'input.tabs=="Switching"',
                         selectInput("InsiderTradingModel2", "Insider Trading Model 2",
                                     c("Dynamic" = "Dynamic",
                                       "BI based" = "BIbased")),
                         sliderInput('periodss','Periods',min=1,max=100,value=30),
                         selectInput("pvar", "Choose a variable", choices = colnames(pressure))
        ))
    })      
  }
)
1
YBS 28 अक्टूबर 2021, 23:19
मैंने यहां आपके उत्तर के आधार पर एक समान Q बनाया है stackoverflow.com/questions/69772735/…
 – 
firmo23
29 अक्टूबर 2021, 20:28