This repository was archived by the owner on Sep 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
229 lines (218 loc) · 7.28 KB
/
ui.R
File metadata and controls
229 lines (218 loc) · 7.28 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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
options(shiny.reactlog = TRUE)
ui <- navbarPage(
"shinyCoreScan",
## Import page ####
tabPanel(
"Data import",
shiny.info::display("v0.9-beta.3"),
useShinyjs(),
sidebarLayout(
sidebarPanel(
h4("Data import"),
radioButtons("import_choosesource",
"Choose data source",
choices = list(
"Sample Data" = "sampledata",
"File Upload" = "fileupload"
),
selected = "sampledata"),
fileInput(
"import_xrffiles",
"Upload bAXIL batch files (*.csv)",
accept = c("text/csv",
"text/comma-separated-values,text/plain",
".csv"),
multiple = TRUE
),
actionButton("import_loaddata", "Load & Parse XRF data"),
hr(),
checkboxInput("import_catmode", "Concatenate core sections"),
checkboxInput("import_descorder", "Sort sections in descending order", value = TRUE),
selectizeInput("import_catpreview_element",
"Element for long core preview",
choices = NULL),
width = 3
),
mainPanel(
plotOutput("catplot"),
DTOutput("sectiontable")
)
)
),
## Diagnostics page ####
tabPanel(
"Diagnostics",
selectizeInput('diagnostics_core_id', 'Choose Core ID', NULL),
withSpinner(
plotOutput(
"diagnostics_diagnosticsplot",
height = 600,
click = "diagnostics_diagnosticsplot_click",
brush = brushOpts(id = "diagnostics_diagnosticsplot_brush")
)
),
hr(),
fluidRow(
column(
3,
h4("Plot options"),
selectizeInput(
"diagnostics_diagmode",
"Diagnostic mode",
choices = list(
"Element spectra (cps)" = "cpsdiag",
"Relative standard deviation" = "relstdevdiag",
"Goodness of fit" = "chisqdiag"
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
numericInput(
inputId = "diagnostics_ymin",
label = "Y min",
value = NA
)
),
div(
style = "display: inline-block;vertical-align:top; width: 150px;",
numericInput(
inputId = "diagnostics_ymax",
label = "Y max",
value = NA
)
),
sliderInput(
"diagnostics_xlims",
label = "X limits (Core length)",
min = 0,
max = 100,
value = c(40, 60)
),
numericInput(
"diagnostics_medrelstdev",
HTML("Mark |σ<sub>rel</sub>| median spectrum threshold"),
value = 99
),
numericInput(
"diagnostics_maxrelstdev",
HTML("σ<sub>rel</sub>: Draw horizontal line"),
value = 20
),
numericInput(
"diagnostics_chi2cutoff",
HTML("χ<sup>2</sup>: Draw horizontal line"),
value = 5
)
),
column(
3,
h4(HTML(paste(
"Exclude data for", textOutput("diagnostics_coreid_text", inline = TRUE)
))),
pickerInput(
inputId = "diagnostics_elements_excl",
label = "Include/Exclude Elements",
choices = NULL,
options = list(`actions-box` = TRUE),
multiple = TRUE
),
hr(),
p(strong("Exclude depths")),
HTML(
paste0(
"To exclude measurements, select/brush them on the plot and choose 'Remove points'. ",
span(
style = "color:red",
"Brushed measurements are removed for every element of a core! NB: Measurements with negative cps values are always automatically excluded."
)
)
),
p(),
actionButton("diagnostics_exclude_rmpoints", "Remove points", class = "btn-warning"),
p(),
actionButton("diagnostics_exclude_reset", "Reset current core", class = "btn-danger"),
hr(),
downloadButton("diagnostics_saveplot", "Download diagnostics plot"),
p()
),
column(6,
h4(HTML(
"Overview of changes"
)),
DTOutput("diagnostics_excltable"))
)
),
## Plotting page ####
tabPanel("Plotting",
selectizeInput(
inputId = "plotting_mode",
label = "Select plot mode",
options = list(placeholder = "Upload data first"),
multiple = FALSE,
choices = character(0)
),
plotOutput(
"plotting_plotout",
height = 600,
click = "plotting_plotout_click",
brush = brushOpts(id = "plotting_plotout_brush")
),
hr(),
fluidRow(
column(
3,
h4("Compute traces"),
selectizeInput("plotting_choose_1cXe", "Choose Core", choices = NULL), # only shown for 1cXe mode
pickerInput(
inputId = "plotting_choose_Xc1e",
label = "Choose multiple cores",
choices = NULL,
multiple = TRUE,
options = list(`actions-box` = TRUE)), # only shown for Xc1e mode
textOutput("plotting_longcorename"), # only shown for longcore mode
pickerInput(
inputId = "plotting_chooseproxies",
label = "Calculate ratios? Choose proxies",
choices = NULL,
options = list(`actions-box` = TRUE),
multiple = TRUE
), # always shown
fileInput("plotting_addtraces", "Upload additional traces (*.csv)", multiple = TRUE, accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv")
), # only shown for 1cXe mode
pickerInput(
inputId = "plotting_choosetraces",
label = "Choose traces to plot",
choices = NULL,
options = list(`actions-box` = TRUE, `live-search` = TRUE),
multiple = TRUE
), # shown for 1cXe mode and longcore mode
pickerInput(
inputId = "plotting_choosetrace_Xc1e",
label = "Choose trace to plot",
choices = NULL,
options = list(`actions-box` = TRUE, `live-search` = TRUE),
multiple = FALSE
), # shown for Xc1e mode
p()
),
column(
3,
h4("Plot options"),
selectizeInput(
inputId = "plotting_theme",
label = "Choose plot theme",
choices = names(gg2themes)
),
actionButton("plotting_redraw", "(Re)draw plot", class = "btn-primary"), # always shown
downloadButton("plotting_saveplot", "Download plot"),
p()
)
))#,
## Statistics page ####
#tabPanel("Statistics", ),
## Export page ####
#tabPanel("Export", )
)