-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
144 lines (129 loc) · 4.01 KB
/
ui.R
File metadata and controls
144 lines (129 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
library(shiny)
library(tidyverse)
library(shinyWidgets)
library(plotly)
library(cowplot)
library(httr)
library(RCurl)
library(cicerone)
library(shinyjs)
library(shinyBS)
#specify choices
specs= c("Aeropedellus clavatus", "Melanoplus boulderensis", "Chloealtis abdominalis", "Camnula pellucida", "Melanoplus dawsoni", "Melanoplus sanguinipes")
elevs= c("1752m", "2195m", "2591m", "3048m")
initials = c("1958", "1959", "1960")
resurveys = c("2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015")
# Define UI
shinyUI <- fluidPage(
tags$head(
tags$link(rel = "icon", type = "image/x-icon", href = "favicon.ico")
),
use_cicerone(),
useShinyjs(),
title = "Grasshoppers",
setBackgroundColor(color = "white"),
titlePanel(
div(tags$img(src="TrenchEdLogo.png", height = 150),
"How Grasshopper Development shifts with Climate Change")
),
includeMarkdown("include.md"),
actionBttn(
inputId = "reset1",
label = "Reset",
style = "material-flat",
color = "danger",
size = "xs"
),
bsTooltip("reset1", "If you have already changed the variables, reset them to default here before starting the tour."),
actionBttn(
inputId = "tour1",
label = "Take a tour!",
style = "material-flat",
color = "success",
size = "sm"
),
hr(),
# Place the filter horizontally
div(
id = "viz-wrapper",
fluidRow(
column(4,
div(
id = "facet-wrapper",
radioButtons('facet', 'Select variable for columns', c("Species", "Year"), inline = TRUE)
)
),
column(4,
div(
id = "spec-wrapper",
pickerInput('species.sel', 'Select species to plot', choices = as.character(specs), multiple = TRUE, selected = "Melanoplus sanguinipes",
options = list(`actions-box` = TRUE))
)
),
column(4,
div(
id = "period-wrapper",
pickerInput('period', 'Select years to plot',
choices = list(Initial = as.character(initials), Resurvey = as.character(resurveys)),
options = list(`actions-box` = TRUE),
multiple = TRUE,
selected = initials)
)
)
),
#pick species and sites
fluidRow(
column(4,
div(
id = "x-wrapper",
radioButtons('x', 'Predictor variable (X)', c('Day of Year', 'Cumulative GDDs'), inline = TRUE)
)
),
column(4,
div(
id = "elev-wrapper",
pickerInput('sites.sel', 'Select sites to plot', choices = as.character(elevs), multiple = TRUE, selected = elevs,
options = list(`actions-box` = TRUE))
)
)
),
# Show a plot of the generated distribution
plotlyOutput(outputId = "trendPlot")
),
hr(),
includeMarkdown("include2.md"),
actionBttn(
inputId = "reset2",
label = "Reset",
style = "material-flat",
color = "danger",
size = "xs"
),
bsTooltip("reset2", "If you have already changed the variables, reset them to default here before starting the tour."),
actionBttn(
inputId = "tour2",
label = "Take a tour!",
style = "material-flat",
color = "success",
size = "sm"
),
hr(),
fluidRow(
column(5,
div(
id = "spec2-wrapper",
pickerInput('species.sel2', 'Select species to plot', choices = specs, multiple = TRUE, selected = "Melanoplus sanguinipes",
options = list(`actions-box` = TRUE))
)
),
column(5,
div(
id = "elev2-wrapper",
pickerInput('sites.sel2', 'Select sites to plot', choices = elevs, multiple = TRUE, selected = elevs,
options = list(`actions-box` = TRUE))
)
)
),
plotOutput(outputId = "secondPlot"),
hr()
)