This repository has been archived by the owner on Jan 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ui.R
114 lines (95 loc) · 5.08 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
# Parameters & data
source('./code/param.R')
# User interface setup
ui <- bootstrapPage(
useShinyjs(),
withMathJax(),
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CSS STYLE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
tags$head(
tags$link(rel = "stylesheet", type = "text/css", href = "eDrivers.css")
),
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTERACTIVE MAP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# Map output
leafletOutput(outputId = "map", width = '80%', height = '100%'),
# Check box output to select drivers to visualize
absolutePanel(id = 'checkPanel1',
draggable = FALSE,
left = '14',
top = '130',
height = '690px',
# Collapse button
HTML('<button data-toggle="collapse" data-target="#demo"> ⇱ </button>'),
# Check all button
actionButton("CheckAll", label = '', icon = icon('check-square')),
# Uncheck button
actionButton("Uncheck", label = '', icon = icon('sync')),
# Collapsable and selectable driver table
tags$div(id = 'demo', class="collapse in",
absolutePanel(id = 'checkPanel2',
draggable = TRUE,
h5('Drivers'),
hr(),
# Raw vs transformed data choice
radioButtons(inputId = 'rawData',
label = '',
inline = T,
choiceNames = c('Raw data','Transformed'),
choiceValues = c('rawData','transformed'),
selected = 'transformed'),
# Hotspots vs footprint choice
radioButtons(inputId = 'dataType',
label = '',
inline = T,
choiceNames = c('Intensity','Hotspots'),
choiceValues = c('footprint','hotspots'),
selected = 'footprint'),
hr(),
# Drivers table
checkboxGroupInput(inputId = 'layersTable',
label = '',
choiceNames = layers$Drivers,
choiceValues = layers$FileName)
))),
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ INFORMATION PANEL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
conditionalPanel(condition = 'input.layersTable.length < 1',
absolutePanel(id = 'infoPanel1',
right = '0',
top = '0',
bottom = '0',
left = '80%',
htmlOutput('eDrivers'))),
conditionalPanel(condition = 'input.layersTable.length == 1',
absolutePanel(id = 'infoPanel2',
right = '0',
top = '0',
bottom = '0',
left = '80%',
htmlOutput('dataDescription'),
div(plotOutput('singlePlot', width = '95%', height = '300px'),align = 'center'),
htmlOutput('dataOverview'))),
conditionalPanel(condition = 'input.layersTable.length > 1 && input.rawData == "transformed"',
absolutePanel(id = 'infoPanel3',
right = '0',
top = '0',
bottom = '0',
left = '80%',
htmlOutput('multiDescription'),
div(plotOutput('multiPlot', width = '95%', height = '700px'),align = 'center'))),
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ WARNING PANEL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
conditionalPanel(condition = "input.layersTable.length > 1 && input.rawData == 'rawData'",
absolutePanel(id = 'warningMessage',
top = '50%',
left = '50%',
right = '20%',
bottom = '20%',
htmlOutput('warningMSG')
))
) # End