Skip to content

Commit 1badd29

Browse files
committed
Added first simulation results elements
1 parent f26f333 commit 1badd29

2 files changed

Lines changed: 234 additions & 70 deletions

File tree

R/mod_tool_UI.R

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ mod_tool_UI <- function(id, i18n){
132132
style = "font-style: italic;"
133133
)
134134

135-
## ++ Checl Progress bar -----------------------------------------------------------
135+
## ++ Check Progress bar -----------------------------------------------------------
136136
div_check_progress <- shinyjs::hidden(div(
137137
id = ns("check_progress"),
138138
shinyWidgets::progressBar(
@@ -177,7 +177,7 @@ mod_tool_UI <- function(id, i18n){
177177
)
178178

179179
## Combine value boxes
180-
div_value_boxes <- shinyjs::hidden(div(
180+
div_check_vbs <- shinyjs::hidden(div(
181181
id = ns("check_vbs"),
182182
layout_column_wrap(
183183
#width = "200px",
@@ -204,7 +204,7 @@ mod_tool_UI <- function(id, i18n){
204204
)
205205

206206
## combine cards
207-
div_cards <- shinyjs::hidden(div(
207+
div_check_cards <- shinyjs::hidden(div(
208208
id = ns("check_cards"),
209209
layout_columns(
210210
card_check_msg, card_arithmetic_gg
@@ -234,52 +234,72 @@ mod_tool_UI <- function(id, i18n){
234234
)
235235
))
236236

237-
div_btn_show_res <- shinyjs::hidden(div(
238-
id = ns("btn_show_res"),
237+
div_res_show <- shinyjs::hidden(div(
238+
id = ns("res_show"),
239239
actionButton(inputId = ns("btn_show_res"), label = "Show simulation results")
240240
))
241241

242242
## ++ Res cards --------------------------------------------------------------
243243
card_res_dl <- card(
244+
fill = FALSE,
244245
h5(i18n$t("Download the simulations and aggregated results")),
245-
"Download land use transition level emissions",
246-
"Download aggregated results",
247-
"Download forest plots",
246+
downloadButton(
247+
outputId = ns("dl_ari"),
248+
label = "Download the arithmetic mean ERs", class = "btn-outline-secondary btn-small form-group"
249+
),
250+
downloadButton(
251+
outputId = ns("dl_res"),
252+
label = "Download the simulated ERs", class = "btn-outline-secondary btn-small form-group"
253+
),
254+
downloadButton(
255+
outputId = ns("dl_ari"),
256+
label = "Download all the ER simulations", class = "btn-outline-warning btn-small form-group"
257+
),
258+
downloadButton(
259+
outputId = ns("dl_ari"),
260+
label = "Download all the land use transition simulations", class = "btn-outline-warning btn-small form-group"
261+
),
262+
downloadButton(
263+
outputId = ns("dl_ari"),
264+
label = "Download all the forest plots", class = "btn-outline-primary btn-small form-group"
265+
),
248266
)
267+
249268
card_res_fp <- card(
250269
h5(i18n$t("Emission reductions details")),
251-
gt::gt_output(ns("res_fp"))
270+
gt::gt_output(ns("res_ER_fp"))
252271
)
253272

254273
card_res_gg <- card(
255-
h5(i18n$t("Emission reductions figure")),
256-
plotOutput(ns("res_gg"))
274+
h5(i18n$t("Emission reductions histogram")),
275+
uiOutput(outputId = ns("select_ER_hist_UI")),
276+
plotOutput(ns("res_ER_hist"))
257277
)
258278

259279
card_redd_fp <- card(
260280
h5(i18n$t("REDD+ Activity details")),
261-
gt::gt_output(ns("redd_fp"))
281+
gt::gt_output(ns("res_redd_fp"))
262282
)
263283

264284
card_redd_hist <- card(
265285
h5(i18n$t("REDD+ activity histograms")),
266286
uiOutput(outputId = ns("select_redd_hist_UI")),
267-
plotOutput(ns("redd_hist"))
287+
uiOutput(outputId = ns("select_period_hist_UI")),
288+
plotOutput(ns("res_redd_hist"))
268289
)
269290

270291
card_trans_fp <- card(
271292
h5(i18n$t("Land use transition period")),
272-
gt::gt_output(ns("trans_fp"))
293+
gt::gt_output(ns("res_trans_fp"))
273294
)
274295

275296
## +++ combine cards
276297
div_res_cards <- shinyjs::hidden(div(
277298
id = ns("res_cards"),
278299
card_res_dl,
279-
layout_columns(card_tab_ref, card_hist_ref),
280-
layout_columns(card_tab_mon, card_hist_ref),
281-
layout_columns(card_tab_ER, card_hist_ER),
282-
300+
layout_columns(col_widths = c(8, 4), card_res_fp, card_res_gg),
301+
layout_columns(col_widths = c(8, 4), card_redd_fp, card_redd_hist),
302+
card_trans_fp
283303
))
284304

285305
##
@@ -293,7 +313,7 @@ mod_tool_UI <- function(id, i18n){
293313
br(),
294314

295315
navset_card_tab(
296-
id = ns("tool_panels"),
316+
id = ns("tool_tabs"),
297317

298318
## + Sidebar =============================================================
299319

@@ -324,9 +344,9 @@ mod_tool_UI <- function(id, i18n){
324344
div_check_progress,
325345
div_btn_show_check,
326346
## Checks
327-
div_value_boxes,
347+
div_check_vbs,
328348
br(),
329-
div_cards
349+
div_check_cards
330350
),
331351

332352
## + MCS panel ===========================================================
@@ -339,8 +359,9 @@ mod_tool_UI <- function(id, i18n){
339359
div_res_init,
340360
## progress bar
341361
div_res_progress,
342-
div_btn_show_res,
343-
card_trans_tab
362+
div_res_show,
363+
## cards
364+
div_res_cards
344365
),
345366

346367
## + Sensitivity analysis panel ============================================

0 commit comments

Comments
 (0)