Browse Source

Rearrange UI

Petra Lamborn 5 years ago
parent
commit
60f0a69b83
1 changed files with 28 additions and 31 deletions
  1. 28
    31
      app.R

+ 28
- 31
app.R View File

@@ -26,38 +26,35 @@ Sector.Fuels <- function(sector) {
26 26
 
27 27
 
28 28
 # UI ----
29
-ui <- fluidPage(
30
-   
31
-   titlePanel("NZ greenhouse gas emissions 1990-2010"),
32
-   
33
-   sidebarLayout(
34
-      # Sidebar ----
35
-      sidebarPanel(
36
-        sliderInput("secyears", "Date range", 
37
-                    min=1990, max=2010, value=c(1990, 2010),
38
-                    sep="", step=1),
39
-        selectInput("secscale", "Scale", 
40
-                    choices=c("y", "sqrt(y)", "log10(y)"), selected="y"),
41
-        checkboxGroupInput("secSectors", "Sectors", 
42
-                           choices=sectors.a, selected = sectors.a),
43
-        checkboxInput("seclegend", "Show legend", value=TRUE),
44
-        checkboxInput("secminc", "Set minimum", value=FALSE),
45
-        conditionalPanel("input.secminc",
46
-                         numericInput("secmin", label=NULL, value=NA)),
47
-        checkboxInput("secmaxc", "Set maximum", value=FALSE),
48
-        conditionalPanel("input.secmaxc",
49
-                         numericInput("secmax", label=NULL, value=NA)),
50
-      width=3),
51
-      
52
-      # Main panel ----
53
-      mainPanel(
54
-        tabsetPanel(id="tabs",
55
-                   tabPanel("By Sector", 
56
-                            plotOutput("secPlot")
57
-                            )
29
+ui <- navbarPage("NZ Emissions", collapsible = TRUE,
30
+   # Sector tab ----
31
+   tabPanel("Sector",
32
+                h3("Emissions by sector"),
33
+                plotOutput("secPlot"),
34
+                fluidRow(
35
+                 column(5, offset=1,
36
+                        h4("Options"),
37
+                    sliderInput("secyears", "Date range", 
38
+                      min=1990, max=2010, value=c(1990, 2010),
39
+                      sep="", step=1),
40
+                    selectInput("secscale", "Scale", 
41
+                      choices=c("y", "sqrt(y)", "log10(y)"), selected="y"),
42
+                    checkboxInput("seclegend", "Show legend", value=TRUE),
43
+                    checkboxInput("secminc", "Set minimum", value=FALSE),
44
+                    conditionalPanel("input.secminc",
45
+                     numericInput("secmin", label=NULL, value=NA)),
46
+                    checkboxInput("secmaxc", "Set maximum", value=FALSE),
47
+                    conditionalPanel("input.secmaxc",
48
+                     numericInput("secmax", label=NULL, value=NA))
49
+                        ),
50
+                 column(5, offset=1,
51
+                      h4("Sectors"),
52
+                     checkboxGroupInput("secSectors", NULL, 
53
+                      choices=sectors.a, selected = sectors.a)
58 54
                     )
59
-      )
60
-   )
55
+                )             
56
+        ),
57
+     tabPanel("By fuel")
61 58
 )
62 59
 
63 60
 server <- function(input, output) {