-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.R
63 lines (54 loc) · 1.86 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
###############################################################
####################### sHyMetDScompare #######################
#### A Shiny-Leaflet interface for time series analysis. #####
###############################################################
# Analysis tool to compare interpolated climate data service
# with location data
#
# By M. Marchildon
# v.1.0
# Dec, 2024
###############################################################
for (f in list.files("pkg", pattern="*.R", recursive = TRUE, full.names = TRUE)) {source(f, local = TRUE)}
ggres <<- 128
shinyApp(
ui <- fluidPage(
useShinyjs(),
tags$head(includeCSS("pkg/styles.css")),
inlineCSS(appLoad),
# Loading message
div(
id = "loading-content",
div(class='space300'),
h2("Loading..."),
div(img(src='ORMGP_logo_no_text_bw_small.png')), br(),
shiny::img(src='loading_bar_rev.gif')
),
# The main app
hidden(
div(
id = "app-content",
list(tags$head(HTML('<link rel="icon", href="favicon.png",type="image/png" />'))),
div(style="padding: 1px 0px; height: 0px", titlePanel(title="", windowTitle="sHyMetDScompare")), # height: 0px
source(file.path("ui", "ui_main.R"), local = TRUE)$value
)
)
),
server <- function(input, output, session){
###################
### Parameters & methods:
for (f in list.files("srv", pattern="*.R", recursive = TRUE, full.names = TRUE)) {source(f, local = TRUE)}
###################
### collect data:
# collect_temporal(730900042) #360000048) #(148690) #(148945)
observe({
query <- parseQueryString(session$clientData$url_search)
if (!is.null(query[['iid']])) {
collect_temporal(query[['iid']])
} else {
showNotification(paste0("Error: URL invalid."))
}
})
session$onSessionEnded(stopApp)
}
)