Увеличить высоту выбранного входа - PullRequest
0 голосов
/ 29 октября 2019

Есть ли способ увеличить размер selectInput(), увеличив его высоту? По сути, я хочу, чтобы отображались все доступные варианты, и чтобы поле ввода ввода было больше.

#ui.r
fluidPage(

  # Copy the line below to make a select box 
  selectInput("select", label = h3("Select box"), 
    choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3), 
    selected = 1),

  hr(),
  fluidRow(column(3, verbatimTextOutput("value")))

)
#server.r
function(input, output) {

  # You can access the value of the widget with input$select, e.g.
  output$value <- renderPrint({ input$select })

}

1 Ответ

0 голосов
/ 29 октября 2019

Вы можете использовать следующее и попробовать, если это работает:

library(shiny)

    ui <- fluidPage(
      fluidRow(

        selectInput("distance", label=NULL, choices = list("1" = 1, "2" = 2), selected = 1),
        tags$head(tags$style(HTML(".selectize-input {height: 150px; width: 550px; font-size: 50px;}")))
      )

)
server <- function(input, output){}
shinyApp(ui, server)

Здесь вы можете установить размер selectInput как height и width.

С checkboxGroupInput:

library(shiny)

ui<-fluidPage(

    # Copy the line below to make a select box 
    checkboxGroupInput("select", label = h3("Select box"), 
                choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3), 
                selected = 1),

    hr(),
    fluidRow(column(3, verbatimTextOutput("value")))

  )
  #server.r
 server<- function(input, output) {

    # You can access the value of the widget with input$select, e.g.
    output$value <- renderPrint({ input$select })

  }

shinyApp(ui, server)

С радиоButton:

ui<-fluidPage(

    # Copy the line below to make a select box 
    radioButtons("select", label = h3("Select box"), 
                choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3), 
                selected = 1),

    hr(),
    fluidRow(column(3, verbatimTextOutput("value")))

  )
  #server.r
 server<- function(input, output) {

    # You can access the value of the widget with input$select, e.g.
    output$value <- renderPrint({ input$select })

  }

shinyApp(ui, server)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...