From 172eaaeccd09ac04fd657f3f680309e55c788616 Mon Sep 17 00:00:00 2001 From: Lambert Patrick Date: Tue, 2 May 2023 22:19:23 +0200 Subject: [PATCH] feat: add ices_division in run_app Issue: #158 --- NAMESPACE | 1 + R/globals.R | 2 +- R/mod_a_first.R | 1 + R/mod_a_first_fct_map.R | 3 ++- R/run_app.R | 4 +++- dev/run_dev.R | 1 + man/run_app.Rd | 3 ++- man/tm_draw.Rd | 3 ++- 8 files changed, 13 insertions(+), 5 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 6499083..10a9307 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -80,6 +80,7 @@ importFrom(tibble,rownames_to_column) importFrom(tidyr,expand_grid) importFrom(tidyr,pivot_longer) importFrom(tidyr,pivot_wider) +importFrom(tmap,tm_borders) importFrom(tmap,tm_polygons) importFrom(tmap,tm_shape) importFrom(utils,getFromNamespace) diff --git a/R/globals.R b/R/globals.R index 0cf93fb..cc139c2 100644 --- a/R/globals.R +++ b/R/globals.R @@ -21,7 +21,7 @@ globalVariables(unique(c( "basin_id", "year", "hsi_min", "hsi_max", "label", "hsi_movingavg", "species_id", "nit_mean", "nit_min", "nit_max", "nit_movingavg", # tm_draw: - "ices_type", "latin_name", "nb_occurence", "tm_frontiers", + "ices_type", "latin_name", "nb_occurence", "tm_frontiers", "ices_division", # translation_help: "contenu_markdown", "en", "es", "fr", "pt", # others diff --git a/R/mod_a_first.R b/R/mod_a_first.R index 2eec268..e30a3a3 100644 --- a/R/mod_a_first.R +++ b/R/mod_a_first.R @@ -100,6 +100,7 @@ mod_first_server <- function(id, r = r) { catchment_geom = golem::get_golem_options("catchment_geom"), dataALL = golem::get_golem_options("dataALL"), ices_geom = golem::get_golem_options("ices_geom"), + ices_division = golem::get_golem_options("ices_division"), session = session ) }) diff --git a/R/mod_a_first_fct_map.R b/R/mod_a_first_fct_map.R index cabfb3a..e9dd755 100644 --- a/R/mod_a_first_fct_map.R +++ b/R/mod_a_first_fct_map.R @@ -97,13 +97,14 @@ tm_catchmment <- function(dataContinent) { # Do it once bbox <- sf::st_bbox(c(xmin = -17.5, xmax = 19, ymax = 36, ymin = 62), crs = sf::st_crs(4326)) + #' Title #' #' @param species_latin_name The latin name of the species #' @param spatial_type Geom to use in the map #' @param con The Connection object #' @param yearStart,yearEnd date used -#' @param dataCatchment,catchment_geom,dataALL,ices_geom internal datasets +#' @param dataCatchment,catchment_geom,dataALL,ices_geom,ices_division internal datasets #' @param session The Shiny Session object #' #' @return A tmap object diff --git a/R/run_app.R b/R/run_app.R index d974249..f2e2a07 100644 --- a/R/run_app.R +++ b/R/run_app.R @@ -2,7 +2,7 @@ #' #' @param species_list list of species to use in the app #' @inheritParams shiny::shinyApp -#' @param dataCatchment,catchment_geom,dataALL,ices_geom,countries_mortalities_list internal datasets +#' @param dataCatchment,catchment_geom,dataALL,ices_geom,ices_division,countries_mortalities_list internal datasets #' @param help_bubble_entries A character vector corresponding to all #' keys (entries)of help bubbles to be displayed. #' @@ -20,6 +20,7 @@ run_app <- function( countries_mortalities_list, dataALL = dataALL, ices_geom = ices_geom, + ices_division = ices_division, help_bubble_entries = get_help_bubble_entries() ) { cli::cat_rule("run_app") @@ -39,6 +40,7 @@ run_app <- function( catchment_geom = catchment_geom, dataALL = dataALL, ices_geom = ices_geom, + ices_division = ices_division, help_bubble_entries = help_bubble_entries ) ) diff --git a/dev/run_dev.R b/dev/run_dev.R index 3defffa..2daddc4 100644 --- a/dev/run_dev.R +++ b/dev/run_dev.R @@ -51,5 +51,6 @@ run_app( catchment_geom = datasets[["catchment_geom"]], dataALL = datasets[["dataALL"]], ices_geom = datasets[["ices_geom"]], + ices_division = datasets[["ices_division"]], help_bubble_entries = get_help_bubble_entries() ) diff --git a/man/run_app.Rd b/man/run_app.Rd index 83d20ce..be656b5 100644 --- a/man/run_app.Rd +++ b/man/run_app.Rd @@ -14,6 +14,7 @@ run_app( countries_mortalities_list, dataALL = dataALL, ices_geom = ices_geom, + ices_division = ices_division, help_bubble_entries = get_help_bubble_entries() ) } @@ -35,7 +36,7 @@ for more information on bookmarking your app.} \item{species_list}{list of species to use in the app} -\item{dataCatchment, catchment_geom, dataALL, ices_geom, countries_mortalities_list}{internal datasets} +\item{dataCatchment, catchment_geom, dataALL, ices_geom, ices_division, countries_mortalities_list}{internal datasets} \item{help_bubble_entries}{A character vector corresponding to all keys (entries)of help bubbles to be displayed.} diff --git a/man/tm_draw.Rd b/man/tm_draw.Rd index 68e1a02..b603514 100644 --- a/man/tm_draw.Rd +++ b/man/tm_draw.Rd @@ -14,6 +14,7 @@ tm_draw( catchment_geom, dataALL, ices_geom, + ices_division, session = shiny::getDefaultReactiveDomain() ) } @@ -26,7 +27,7 @@ tm_draw( \item{yearStart, yearEnd}{date used} -\item{dataCatchment, catchment_geom, dataALL, ices_geom}{internal datasets} +\item{dataCatchment, catchment_geom, dataALL, ices_geom, ices_division}{internal datasets} \item{session}{The Shiny Session object} }