-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUI.r
139 lines (103 loc) · 4.73 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
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
##################################
# MeadoWatch WTA Analysis
# Adapted by Aji John #
# original by Alessio Benedetti #
# ui.R file #
##################################
library(leaflet)
library(shinydashboard)
library(collapsibleTree)
library(shinycssloaders)
library(DT)
library(tigris)
###########
# LOAD UI #
###########
shinyUI(fluidPage(
# load custom stylesheet
includeCSS("www/style.css"),
# load google analytics script
#tags$head(includeScript("www/google-analytics-bioNPS.js")),
# remove shiny "red" warning messages on GUI
tags$style(type="text/css",
".shiny-output-error { visibility: hidden; }",
".shiny-output-error:before { visibility: hidden; }"
),
# load page layout
dashboardPage(
skin = "green",
dashboardHeader(title="MeadoWatch/WTA Analysis", titleWidth = 300),
dashboardSidebar(width = 300,
sidebarMenu(
HTML(paste0(
"<br>",
"<a><img style = 'display: block; margin-left: auto; margin-right: auto;' src='mountain.svg' width = '186'></a>",
"<br>",
"<br>"
)),
menuItem("Home", tabName = "home", icon = icon("home")),
menuItem("Hikes", tabName = "map", icon = icon("thumbtack")),
menuItem("Phenology at sites", tabName = "table", icon = icon("table")),
menuItem("Model fitting curves", tabName = "charts", icon = icon("stats", lib = "glyphicon")),
menuItem("Flowering richness", tabName = "richness", icon = icon("map marked alt")),
menuItem("MW WTA analysis", tabName = "wta", icon = icon("random", lib = "glyphicon")),
menuItem("Releases", tabName = "releases", icon = icon("tasks")),
HTML(paste0(
"<br><br><br><br><br><br><br><br><br>",
"<table style='margin-left:auto; margin-right:auto;'>",
"<tr>",
"</tr>",
"</table>",
"<br>"),
HTML(paste0(
"<script>",
"var today = new Date();",
"var yyyy = today.getFullYear();",
"</script>",
"<div>Icons made by <a href='https://www.flaticon.com/authors/freepik' title='Freepik'>Freepik</a></div>",
"<p style = 'text-align: center;'><small>Template credit <a>alessiobenedetti.com</a>-<script>document.write(yyyy);</script></small></p>")
))
)
), # end dashboardSidebar
dashboardBody(
tabItems(
tabItem(tabName = "home",
# home section
includeMarkdown("www/home.md")
),
tabItem(tabName = "map",
# trails map section
leafletOutput("trailsMap") %>% withSpinner(color = "green")
),
tabItem(
# pheno sites observations
tabName = "table", dataTableOutput("phenoSiteDataTable") %>% withSpinner(color = "green")
),
tabItem(tabName = "wta",
# include the WTA Analysis
includeMarkdown("www/WTA.md")
),
tabItem(tabName = "charts",
# ggplot2 species charts section
includeMarkdown("www/charts.md"),
fluidRow(column(3, uiOutput("categorySelectComboChart"))),
column(6, plotOutput("ggplot2Group1") %>% withSpinner(color = "green")),
column(6, plotOutput("ggplot2Group2") %>% withSpinner(color = "green"))
),
tabItem(tabName = "richness",
# richness
includeMarkdown("www/richness.md"),
fluidRow(
column(3, uiOutput("yearSelectCombo")),
column(3, uiOutput("speciesCombo"))
),
fluidRow(
column(6, plotOutput("ggplot2Group3") %>% withSpinner(color = "green")),
column(6, plotOutput("ggplot2Group4") %>% withSpinner(color = "green"))
)
),
tabItem(tabName = "releases", includeMarkdown("www/releases.md"))
)
) # end dashboardBody
)# end dashboardPage
))