inst/app/R/funcs.R

# display debugging messages in R if local,
# or in the console log if remote
debug_msg <- function(...) {
  is_local <- Sys.getenv('SHINY_PORT') == ""
  txt <- paste(...)
  if (is_local) {
    message(txt)
  } else {
    shinyjs::logjs(txt)
  }
}

## datatable constants ----
dt_options <- function() {
  list(
    info = FALSE,
    lengthChange = FALSE,
    paging = FALSE,
    ordering = FALSE,
    searching = FALSE,
    pageLength = 500,
    keys = TRUE
  )
}
debruine/webmorphR documentation built on Aug. 15, 2022, 3:51 p.m.