Saturday, May 4, 2024
HomeCSScss - How do I drive R Shiny selectizeInput to fill the...

css – How do I drive R Shiny selectizeInput to fill the out there area?


I am constructing a shiny app that enables the consumer to pick out quite a lot of choices close to the highest of the web page which can then have an effect on the subset of the information that’s pulled in and manipulated. Every thing works simply effective with the calculations. The one downside I am having is within the show. As there are a selection of choices, most of that are easy radio buttons with just a few choices, I like the thought of holding the look clear by having one row of choices close to prime of the web page utilizing a splitLayout operate.

For the radio buttons this seems to be effective, however I even have a set of two selectizeInput packing containers. These are associated to one another (one is month and the opposite is yr) so I’ve them in their very own sub-splitLayout operate inside the mum or dad row. Nevertheless, when the app runs the packing containers themselves are squished collectively and unreadable, as proven (the purple circle will not be a part of the app):

enter image description here

I’ve tried varied strategies of adjusting the width of those packing containers, however to no avail. The “Selectize Choices” column itself has loads of area, as indicated by the big quantity of white area to its proper earlier than “Enter 3” however I can not get the precise drop-down packing containers themselves to fill that area. If I am going to the code and regularly enhance the cellWidth argument associated to that field I can ultimately get them to point out appropriately, however at that time I’ve pushed all the pieces else off of the row. I can not determine why they will not match with a “affordable” quantity of area allotted to them. Therefore the query: how can I drive R Shiny to increase these packing containers and refill the area out there to them with out forcing the opposite row components out of the field?

Minimal reproducible instance:

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title= "Minimal Reproducible Instance"),
  
  dashboardSidebar(sidebarMenu(menuItem("Residence", tabName = "Residence"))),
  
  dashboardBody(
    tabItems(
      tabItem(tabName = "Residence",
        h2("Homepage"),
        fluidRow(
          field(title="Choices",width=12,
            splitLayout(cellWidths=c('12%','12%','25%','12%','12%','15%','12%'),
              cellArgs = listing(tags$head(tags$fashion(HTML(".shiny-split-layout > div {overflow: seen;}")))),
              column(width=2,radioButtons('input1',label="Enter 1",decisions = listing('A'='A','B'='B'),chosen = 'A')),
              column(width=2,radioButtons("input2",label="Enter 2",decisions = listing('C'='C','D'='D'),chosen = 'C')),
              column(width=2,
                HTML("<b>Selectize Choices:</b>"),
                splitLayout(cellWidths=c('50%','50%'),
                  selectizeInput("mth",choices=listing(maxOptions=12),label="Month",chosen='01',decisions = listing('01','02','03','04')),
                  selectizeInput("yr",choices=listing(maxOptions=5),label="12 months",chosen='2023',decisions = listing('2019','2022','2023'))
                )
              ),
              column(width=1,radioButtons('input3',label="Enter 3",decisions = listing('E'='E','F'='F'),chosen = 'E')),
              column(width=2,radioButtons("input4",label = "Enter 4",decisions = listing('G'='G','H'='H'),chosen = 'G')),
              column(width=1,radioButtons("input5",label = "Enter 5",decisions = listing('I'='I','J'='J'),chosen = 'I')),
              column(width=1,downloadButton("obtain", "Obtain"))
            ),
            fileInput(width="100%",'uploadfile',buttonLabel="Browse",'Add a File')
          )
        ) 
      )
    )
  )
)

server <- operate(enter, output, session) {}

shinyApp(ui, server)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments