Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material design (md) do not show checkbox #161

Open
elia427 opened this issue Mar 24, 2022 · 0 comments
Open

Material design (md) do not show checkbox #161

elia427 opened this issue Mar 24, 2022 · 0 comments

Comments

@elia427
Copy link

elia427 commented Mar 24, 2022

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
            ))
    })
    
}

)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant