-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.R
96 lines (77 loc) · 2.38 KB
/
app.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
#
# This is a Shiny web application for the NFDI4Earth pilot "GeoFRESH".
#
library(shiny)
# Define UI for GeoFresh application start page
# using Navbar layout
navbarpage <- navbarPage(
title = "GeoFRESH",
id = "navbar",
# link to GeoFRESH CSS file
header = tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "css/styles.css")),
# Panel 1: front page (module: front_page)
frontPageUI("panel1"),
# Panel 2: Upload page
# uploadPageUI("panel2"),
# Panel 3: Analysis page
analysisPageUI("panel3"),
# Panel 4: Demo page
demoPageUI("panel4"),
# Panel 5: start page
tabPanel(
title = "Documentation",
value = "panel5",
div(
style = "margin: auto; padding:0px 11px; max-width: 1500px;",
mainPanel(
div(
includeMarkdown("documentation.md")
),
width = 100
)
)
),
# add common footer to all sub-pages
footer = column(
12,
div(
style = "margin: auto; padding: 6px 22px; max-width: 1500px;",
br(),
hr(),
a(img(src = "./img/nfdi4earth_logo.png", width = 200, align = "left"), href = "https://www.nfdi4earth.de/", target = "_blank"),
a(img(src = "./img/igb_logo.png", width = 200, align = "right"), href = "https://www.igb-berlin.de/", target = "_blank"),
p("GeoFRESH was funded by NFDI4Earth and the Leibniz Institute
of Freshwater Ecology and Inland Fisheries (IGB).",
align = "center",
style = "font-size:0.9em;"
),
p(modalDialogUI("privacy"),
align = "center"
)
)
)
)
# user interface. useShinyjs() needed for button enable/disable in other modules
# must be called here
ui <- tagList(shinyjs::useShinyjs(), navbarpage)
# add the privacy_policy.md" to the footer
# Define server logic for GeoFRESH application
server <- function(input, output, session) {
# get selected navbar page from front_page module server function as
# reactive value
selected_panel <- frontPageServer("panel1")
# activate navbar page when front page action link is selected
observe({
updateNavbarPage(
session,
inputId = "navbar",
selected = paste0("panel", selected_panel())
)
})
# server function of the analysis page module
analysisPageServer("panel3")
# server function of the modal dialogue module
modalDialogServer("privacy")
}
# Run the application
shinyApp(ui = ui, server = server)