Skip to content

Commit

Permalink
⚡ v0.3.0 misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ecoisilva committed Apr 19, 2024
1 parent c5359df commit 58950fc
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion R/mod_comp_pars.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ mod_comp_pars_server <- function(id, rv, set_type) {
} else {
out_ui <- column(
align = "center", width = 12,
NULL) #TODO
NULL) # TODO
}

out <- tagList(
Expand Down
20 changes: 10 additions & 10 deletions R/mod_tab_about.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ mod_tab_about_ui <- function(id) {
wrap_none(span("speed and distance traveled",
class = "cl-sea-d"), ".")),
br(),
p(style = "max-width: 685px;",
span(class = "help-block",
style = "text-align: center !important;",

fontawesome::fa("circle-exclamation", fill = "#dd4b39"),
span("Note:", class = "help-block-note"),
"This is the", span( "development", class = "cl-dgr"),
"version of the application, currently undergoing",
"testing. Use with caution, as it may crash",
"or behave unexpectedly.")),
# p(style = "max-width: 685px;",
# span(class = "help-block",
# style = "text-align: center !important;",
#
# fontawesome::fa("circle-exclamation", fill = "#dd4b39"),
# span("Note:", class = "help-block-note"),
# "This is the", span( "development", class = "cl-dgr"),
# "version of the application, currently undergoing",
# "testing. Use with caution, as it may crash",
# "or behave unexpectedly.")),
p(style = "margin-bottom: 35px;")

) # end of column (text)
Expand Down
19 changes: 13 additions & 6 deletions R/mod_tab_ctsd.R
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,20 @@ mod_tab_ctsd_server <- function(id, rv) {
## Update based on number of simulations: -----------------------------

observe({
req(rv$simList)
req(rv$active_tab == 'ctsd',
rv$simList, rv$ctsdList)
req(length(rv$simList) == length(rv$ctsdList))
rv$sd_nsim <- 1

if (length(rv$simList) == 1) {
shinyjs::hide(id = "sd_nsim")

div(class = "sims-irs",
shinyWidgets::updateSliderTextInput(
session = session,
inputId = "sd_nsim",
label = "Show simulation no.:",
choices = seq(1, length(rv$simList), by = 1),
selected = 1))
} else {
shinyjs::show(id = "sd_nsim")
div(class = "sims-irs",
Expand All @@ -452,8 +460,7 @@ mod_tab_ctsd_server <- function(id, rv) {
selected = length(rv$simList)))
}

}) %>% # end of observer
bindEvent(rv$simList)
}) # end of observer

observe({
req(rv$simList,
Expand Down Expand Up @@ -503,7 +510,7 @@ mod_tab_ctsd_server <- function(id, rv) {
## Sample size boxes for comparing sampling designs: ------------------

output$sdUI_compare_n <- renderUI({
req(rv$simList, input$sd_dur, input$sd_dti)
req(rv$simList, input$sd_dur, input$sd_dti, rv$sd_nsim)

device <- movedesign::fixrates
dti <- device$dti[match(input$sd_dti, device$dti_notes)]
Expand All @@ -515,7 +522,7 @@ mod_tab_ctsd_server <- function(id, rv) {
splitLayout(
parBlock(header = "Initial sampling design:",
value = span(scales::label_comma(
accuracy = 1)(nrow(rv$simList[[1]])), #TODO
accuracy = 1)(nrow(rv$simList[[rv$sd_nsim]])),
"locations", class = "cl-mdn")),

parBlock(header = "Modified sampling design:",
Expand Down
4 changes: 2 additions & 2 deletions R/mod_tab_hrange.R
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ mod_tab_hrange_server <- function(id, rv) {
## Sample size boxes for comparing sampling designs: ------------------

output$hrUI_compare_n <- renderUI({
req(rv$simList, input$hr_dur, input$hr_dti)
req(rv$simList, input$hr_dur, input$hr_dti, rv$sd_nsim)

device <- movedesign::fixrates
dti <- device$dti[match(input$hr_dti, device$dti_notes)]
Expand All @@ -525,7 +525,7 @@ mod_tab_hrange_server <- function(id, rv) {
splitLayout(
parBlock(header = "Initial sampling design:",
value = span(scales::label_comma(
accuracy = 1)(nrow(rv$simList[[1]])), #TODO
accuracy = 1)(nrow(rv$simList[[rv$sd_nsim]])),
"locations", class = "cl-mdn")),

parBlock(header = "Modified sampling design:",
Expand Down
7 changes: 3 additions & 4 deletions R/mod_tab_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ mod_tab_report_server <- function(id, rv) {
req(rv$which_question, rv$which_meta)
req(rv$which_meta == "none")

# TODO show if tau values of pre-run sims apply
# TODO show if tau values of pre-run sims match
if ("Home range" %in% rv$which_question) {

out <- out_hr <- shinyWidgets::pickerInput(
Expand Down Expand Up @@ -1467,7 +1467,7 @@ mod_tab_report_server <- function(id, rv) {

if (!is.list(get_truth)) get_truth <- list(get_truth)
if (!is.list(get_HDI)) get_HDI <- list(get_HDI)
if (!is.list(get_CI)) get_HDI <- list(get_CI)
if (!is.list(get_CI)) get_CI <- list(get_CI)

# i <- 1
for (i in seq_along(type)) {
Expand Down Expand Up @@ -1637,7 +1637,7 @@ mod_tab_report_server <- function(id, rv) {
}

if (!is.list(get_HDI)) get_HDI <- list(get_HDI)
if (!is.list(get_CI)) get_HDI <- list(get_CI)
if (!is.list(get_CI)) get_CI <- list(get_CI)

# i <- 1
for (i in seq_along(type)) {
Expand Down Expand Up @@ -2918,7 +2918,6 @@ mod_tab_report_server <- function(id, rv) {
dplyr::mutate(dur = round("days" %#% dur, 1))
out_tauv <- dt_sd$tau_v[which.min(abs(dt_sd$tau_v - input_tauv))]
out_tauv <- fix_unit(out_tauv, "seconds", convert = TRUE)
# TODO TOCHECK
}

dt_sd <- movedesign::sims_speed[[1]] %>%
Expand Down
2 changes: 1 addition & 1 deletion R/utils_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ plotting_hr <- function(input1,
color = pal[2], size = 1, alpha = .3) +

{ if ("uci" %in% contours) p1 } +
p2 + # TODO TO CHECK
p2 +
{ if ("lci" %in% contours) p3 } +

{ if (show_both)
Expand Down

0 comments on commit 58950fc

Please sign in to comment.