-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.R
More file actions
54 lines (47 loc) · 1.61 KB
/
app.R
File metadata and controls
54 lines (47 loc) · 1.61 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
source("global.R")
shiny_component_tab_1 <- source("components/01_tab_1.R")$value
shiny_component_tab_2 <- source("components/02_tab_2.R")$value
shiny_component_tab_3 <- source("components/03_tab_3.R")$value
shinyApp(
# ................................. #
# Shiny UI Component ----
# ................................. #
ui = shinyUI(
dashboardPage(
title = "Module App",
header = source("dashboardUI/ui.dashboard.header.R", local = T)$value,
sidebar = source("dashboardUI/ui.dashboard.sidebar.R", local = T)$value,
body = source("dashboardUI/ui.dashboard.body.R", local = T)$value
)
),
# ................................. #
# Shiny SERVER Component ----
# ................................. #
#
# Server logic
server = function(input, output, session) {
# Server logic for setup menuItem (01_tab_1.R)
shiny_component_tab_1$server(input, output, session)
# Server logic for toc menuItem (02_tab_2.R)``
shiny_component_tab_2$server(input, output, session)
# Server logic for toc menuItem (03_tab_3.R)
shiny_component_tab_3$server(input, output, session)
# To reset the lag example on app refresh (session and restart)
onSessionEnded(function() {
if ("dplyr" %in% .packages()) {
detach(name = "package:dplyr", unload = TRUE)
}
})
onStop(function() {
if ("dplyr" %in% .packages()) {
detach(name = "package:dplyr", unload = TRUE)
}
if(exists("lagUI")) {
rm(lagUI,envir = .GlobalEnv)
}
if(exists("lagSERVER")) {
rm(lagSERVER,envir = .GlobalEnv)
}
})
}
)