-
Notifications
You must be signed in to change notification settings - Fork 1
/
ui.R
102 lines (91 loc) · 3.86 KB
/
ui.R
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
#Lake Erie: Modeled vs Measured
#for EPA ORD, Center for Computational Toxicology & Exposure (CCTE),
# Great Lakes Toxicology & Ecology Division
#R Shiny App: L.L. Lowe, 2023
#Model outputs from FVCOM Lake Erie, TP and LEEM
#Measured data from [Wilson]
#ui.R is User Interface
#Libraries:
#The dashboard version of Shiny
library(shinydashboard)
#Leaflet is for the interactive map
library(leaflet)
#The error messages are usually due to time zone warnings.
#Comment out when debugging
options( warn = -1 )
source("labels.R")
#Begin entire displayed webpage
dashboardPage(
#Header is title of the page
dashboardHeader(title = shiny_title),
#A sidebar is default, need to disable for single page
dashboardSidebar(disable = TRUE),
#The Dashboard is contained in the Page
dashboardBody(
#Makes the map and plot take 65% and 60% vertical height of browser window
tags$style(type = "text/css", "#map {height: calc(65vh) !important;}"),
tags$style(type = "text/css", "#plotVar1 {height: calc(30vh) !important;}"),
tags$style(type = "text/css", "#plotVar2 {height: calc(30vh) !important;}"),
#Main row - entire window
fluidRow(
#Map fills the left half of the window, in a box
#'primary' is code for blue color
column(width=6,
box(width=NULL, solidHeader=TRUE,status="primary",
leafletOutput("map")),
#Below map, row of plot options
fluidRow(
#Show coordinates (lat/lon and X/Y) of chosen point
column(width=3,
strong("Model Output"),
htmlOutput("plotlatlon"),
htmlOutput("plotxy"),
br()),
#Color map circles, choose which variable
column(width=3,
radioButtons("var", "Color by which variable?",
#choices defined in labels.R
colorby_choices
)),
#Color map circles, choose surface or bottom mean of chosen variable
column(width=3,
radioButtons("colorby", "Color by surface or bottom?",
choices = list("Surface(mean)" = "Surface", "Bottom(mean)" = "Bottom"),
selected = "Surface"))
),), #end row of plot options, end left half of page
#Plot and plot options fill right half of window
column(width=6,
#First row, first plot
fluidRow(
column(width=12,
box(width=NULL,solidHeader=TRUE,status="primary",
plotOutput("plotVar1")))),
#Second row, second plot
fluidRow(
column(width=12,
box(width=NULL,solidHeader=TRUE,status="primary",
plotOutput("plotVar2")))),
#Third row is plot options
fluidRow(
#Choose to display station or no, default is TRUE
column(width=3,
strong("Station Data"),
checkboxInput("checkbox", "Uncheck to remove station data.", value = TRUE)),
#Plot limits
column(width=3,
radioButtons("radio", "Plot Limits",
choices = list("Both model's min/max" = 1, "Each model's min/max" = 2 ),
selected = 1)),
#Add the slider, modify times as needed
column(width=6,
sliderInput("timeRange", label = "Time range",
timeFormat="%F",
min = as.POSIXct("2013-03-02",tz = 'UTC'),
max = as.POSIXct("2013-10-31",tz = 'UTC'),
value = c(as.POSIXct("2013-03-02",tz = 'UTC'),
as.POSIXct("2013-10-31",tz = 'UTC'))))
)#end row of plot options
)#--End right-half window column
)#--End Main Row
)#-- End dashboard Body
)#-- End dashboard Page