Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the width of area around SelectInput in R shiny

Tags:

r

I have a SelectInput in R and there is a lot of blank space around it. Here is the select input in my ui.r:

library(shiny)
shinyUI(pageWithSidebar(
  headerPanel(GetHeader()),

 sidebarPanel(
    selectInput("date", "Select Date:", GetListOfDays(), width="120px")
    #dateInput("date", "Date:", GetListOfDays() ) #value = "2012-02-29")
  ),

  mainPanel(
   uiOutput("plots")
  )

Now when I run the report I see:

enter image description here

Do you see all the blank space to the left of the select input? How can I trim that or remove it?

Thank you.

like image 303
user3022875 Avatar asked Jan 13 '15 18:01

user3022875


1 Answers

It looks like there is a width argument right in the function.

library(shiny)
shinyUI(pageWithSidebar(
  headerPanel(GetHeader()),

  sidebarPanel(
    selectInput("date", "Select Date:", GetListOfDays(), width="120px"),
    width = 2 ### EDIT HERE
  ),

  mainPanel(
    uiOutput("plots")
  )
like image 175
maloneypatr Avatar answered Nov 01 '22 08:11

maloneypatr