shinydashboardPlus icon indicating copy to clipboard operation
shinydashboardPlus copied to clipboard

Material design (md) do not show checkbox

Open elia427 opened this issue 2 years ago • 0 comments

Thanks for the fantastic work! I want to change the appearance of my shiny app, and I found md option in the dashboardPage with md=TRUE is what I needed, even if it is experimental. The problem is that checkboxes do not show in sidebar (both right and left). Moreover, it is challenging to know which tab is selected in the body part as the colour hides the separating lines.

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

menu <- controlbarMenu( id = "controlbarMenu", controlbarItem( "Tab 1", "Welcome to tab 1" ), controlbarItem( "Tab 2", numericInput("num", "Observations:", 200, min = 1, max = 1000, step = 100) ) )

shinyApp( ui = tags$body(class="skin-blue sidebar-mini control-sidebar-open", dashboardPage( md = TRUE, skin = "blue-light", 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")
                               
    ),
    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"), 
                                     uiOutput("mytab32")
                                     
    ),
    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)),
                             checkboxInput(
                                 "checkbox",
                                 "Checkbox:",
                                 value = TRUE, 
                                 width = "100px"
                                 
                             )
            ))
    })
    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)),
                             checkboxInput(
                                 "checkbox",
                                 "Checkbox:",
                                 value = TRUE, 
                                 width = "100px"
                                 
                             )
            ))
    })
    
    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))
            ))
    })
    output$mytab32 <- renderUI({
        tagList(
            conditionalPanel(condition = 'input.tabs=="Tax Loss Harvesting"',
                             selectInput("pvar", "Choose a variable", choices = colnames(rock)),
                             menu
            ))
    })
    
}

)`

elia427 avatar Mar 24 '22 14:03 elia427