diff --git a/DESCRIPTION b/DESCRIPTION index 2bfd0ca..a1934eb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -33,7 +33,6 @@ Imports: leafgl (>= 0.1.1), leaflegend, leaflet (>= 2.1.2), - markdown, magrittr (>= 2.0.3), plyr (>= 1.8.8), purrr (>= 1.0.1), diff --git a/NAMESPACE b/NAMESPACE index 62b9b76..f3dc437 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -50,7 +50,6 @@ importFrom(magrittr,"%>%") importFrom(shiny,HTML) importFrom(shiny,NS) importFrom(shiny,column) -importFrom(shiny,markdown) importFrom(shiny,shinyApp) importFrom(shiny,tagAppendAttributes) importFrom(shiny,tagList) diff --git a/R/app_server.R b/R/app_server.R index 264f985..75fa2ba 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -576,6 +576,17 @@ app_server <- function(input, output, session) { # }) ####### ► Total abundance ---- + # TODO see if this works + # observeEvent(input$fish.park.method.dropdown, { + # output$fish.park.total.plot <- renderUI({ + # req(input$fish.park.dropdown, input$fish.park.method.dropdown) + # park <- stringr::str_replace_all(tolower(input$fish.park.dropdown), c("marine park" = "", "island marine reserve" = "", " " = "")) + # method <- input$fish.park.method.dropdown + # + # img(src = paste0("www/plots/", park, "_", method, "_total_abundance.png"), align = "left", width = "100%") + # }) + # }) + # observeEvent(input$fish.park.method.dropdown, { output$fish.park.total.plot <- renderPlot({ # Changed to summarized data @@ -1882,44 +1893,44 @@ app_server <- function(input, output, session) { }) - ####### ► Info buttons ---- - observeEvent(input$state.ta, - showModal(modalDialog( - title = "How do we measure total abundance?", - htmltools::includeMarkdown(paste0("inst/app/www/popups/total.abundance.md")))) - ) - - observeEvent(input$state.sr, - showModal(modalDialog( - title = "How do we measure species richness?", - htmltools::includeMarkdown(paste0("inst/app/www/popups/species.richness.md")))) - ) - - - observeEvent(input$park.ta, - showModal(modalDialog( - title = "How do we measure total abundance?", - htmltools::includeMarkdown(paste0("inst/app/www/popups/total.abundance.md")))) - ) - - observeEvent(input$park.sr, - showModal(modalDialog( - title = "How do we measure species richness?", - htmltools::includeMarkdown(paste0("inst/app/www/popups/species.richness.md")))) - ) + # ####### ► Info buttons ---- + # observeEvent(input$state.ta, + # showModal(modalDialog( + # title = "How do we measure total abundance?", + # htmltools::includeMarkdown(paste0("inst/app/www/popups/total.abundance.md")))) + # ) + # + # observeEvent(input$state.sr, + # showModal(modalDialog( + # title = "How do we measure species richness?", + # htmltools::includeMarkdown(paste0("inst/app/www/popups/species.richness.md")))) + # ) + # + # + # observeEvent(input$park.ta, + # showModal(modalDialog( + # title = "How do we measure total abundance?", + # htmltools::includeMarkdown(paste0("inst/app/www/popups/total.abundance.md")))) + # ) + # + # observeEvent(input$park.sr, + # showModal(modalDialog( + # title = "How do we measure species richness?", + # htmltools::includeMarkdown(paste0("inst/app/www/popups/species.richness.md")))) + # ) # MARINE PARK ---- # FOR FISH - observeEvent( - input$alert.marinepark, - - showModal(modalDialog( - title = input$fish.park.dropdown, - htmltools::includeMarkdown(paste0("inst/app/www/popups/fish_", - stringr::str_replace_all(tolower(input$fish.park.dropdown), c("marine park" = "", " " = "")), ".md")) - )) - - ) + # observeEvent( + # input$alert.marinepark, + # + # showModal(modalDialog( + # title = input$fish.park.dropdown, + # htmltools::includeMarkdown(paste0("inst/app/www/popups/fish_", + # stringr::str_replace_all(tolower(input$fish.park.dropdown), c("marine park" = "", " " = "")), ".md")) + # )) + # + # ) # Interpretation of trends ---- ####### ► Total abundance ---- diff --git a/R/generate_plots.R b/R/generate_plots.R index d6b1f8e..f63c0e6 100644 --- a/R/generate_plots.R +++ b/R/generate_plots.R @@ -71,7 +71,9 @@ generate_plots <- function() { } p - png(paste0("inst/app/www/plots/", marinepark, "_", method, "_total_abundance.png")) + park.name <- stringr::str_replace_all(tolower(marinepark), c("marine park" = "", "island marine reserve" = "", " " = "")) + + png(paste0("inst/app/www/plots/", park.name, "_", method, "_total_abundance.png"), width = 800, height = 400) print(p) dev.off() diff --git a/R/run_app.R b/R/run_app.R index f58c741..0e6f0dd 100644 --- a/R/run_app.R +++ b/R/run_app.R @@ -5,7 +5,7 @@ #' @inheritParams shiny::shinyApp #' #' @export -#' @importFrom shiny shinyApp markdown +#' @importFrom shiny shinyApp #' @importFrom golem with_golem_options run_app <- function(onStart = NULL, options = list(), diff --git a/app.R b/app.R index d387403..bcb4671 100644 --- a/app.R +++ b/app.R @@ -9,8 +9,6 @@ # googlesheets4::gs4_auth() # 2 -# library(markdown) - # Step 1. Load all functions from package pkgload::load_all(export_all = FALSE, helpers = FALSE, attach_testthat = FALSE) diff --git a/inst/app/www/plots/Jurien Bay Marine Park_UVC_total_abundance.png b/inst/app/www/plots/Jurien Bay Marine Park_UVC_total_abundance.png deleted file mode 100644 index 960a1f8..0000000 Binary files a/inst/app/www/plots/Jurien Bay Marine Park_UVC_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/Lalang-garram Marine Park_stereo-ROVs_total_abundance.png b/inst/app/www/plots/Lalang-garram Marine Park_stereo-ROVs_total_abundance.png deleted file mode 100644 index 4c8fa09..0000000 Binary files a/inst/app/www/plots/Lalang-garram Marine Park_stereo-ROVs_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/Marmion Marine Park_stereo-DOVs_total_abundance.png b/inst/app/www/plots/Marmion Marine Park_stereo-DOVs_total_abundance.png deleted file mode 100644 index 412f678..0000000 Binary files a/inst/app/www/plots/Marmion Marine Park_stereo-DOVs_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/Montebello Islands Marine Park_stereo-DOVs_total_abundance.png b/inst/app/www/plots/Montebello Islands Marine Park_stereo-DOVs_total_abundance.png deleted file mode 100644 index 3b9fab2..0000000 Binary files a/inst/app/www/plots/Montebello Islands Marine Park_stereo-DOVs_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/Ningaloo Marine Park_stereo-BRUVs_total_abundance.png b/inst/app/www/plots/Ningaloo Marine Park_stereo-BRUVs_total_abundance.png deleted file mode 100644 index 597bdb0..0000000 Binary files a/inst/app/www/plots/Ningaloo Marine Park_stereo-BRUVs_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/Ningaloo Marine Park_stereo-DOVs_total_abundance.png b/inst/app/www/plots/Ningaloo Marine Park_stereo-DOVs_total_abundance.png deleted file mode 100644 index 597bdb0..0000000 Binary files a/inst/app/www/plots/Ningaloo Marine Park_stereo-DOVs_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/Rottnest Island Marine Reserve_stereo-BRUVs_total_abundance.png b/inst/app/www/plots/Rottnest Island Marine Reserve_stereo-BRUVs_total_abundance.png deleted file mode 100644 index e5d9b20..0000000 Binary files a/inst/app/www/plots/Rottnest Island Marine Reserve_stereo-BRUVs_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/Rottnest Island Marine Reserve_stereo-DOVs_total_abundance.png b/inst/app/www/plots/Rottnest Island Marine Reserve_stereo-DOVs_total_abundance.png deleted file mode 100644 index e5d9b20..0000000 Binary files a/inst/app/www/plots/Rottnest Island Marine Reserve_stereo-DOVs_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/Rowley Shoals Marine Park_stereo-DOVs_total_abundance.png b/inst/app/www/plots/Rowley Shoals Marine Park_stereo-DOVs_total_abundance.png deleted file mode 100644 index 03af12c..0000000 Binary files a/inst/app/www/plots/Rowley Shoals Marine Park_stereo-DOVs_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/Shark Bay Marine Park_stereo-BRUVs_total_abundance.png b/inst/app/www/plots/Shark Bay Marine Park_stereo-BRUVs_total_abundance.png deleted file mode 100644 index 7552d62..0000000 Binary files a/inst/app/www/plots/Shark Bay Marine Park_stereo-BRUVs_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/Shark Bay Marine Park_stereo-DOVs_total_abundance.png b/inst/app/www/plots/Shark Bay Marine Park_stereo-DOVs_total_abundance.png deleted file mode 100644 index 7552d62..0000000 Binary files a/inst/app/www/plots/Shark Bay Marine Park_stereo-DOVs_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/Shoalwater Islands Marine Park_stereo-DOVs_total_abundance.png b/inst/app/www/plots/Shoalwater Islands Marine Park_stereo-DOVs_total_abundance.png deleted file mode 100644 index 9238262..0000000 Binary files a/inst/app/www/plots/Shoalwater Islands Marine Park_stereo-DOVs_total_abundance.png and /dev/null differ diff --git a/inst/app/www/plots/jurienbay_UVC_total_abundance.png b/inst/app/www/plots/jurienbay_UVC_total_abundance.png new file mode 100644 index 0000000..a32d355 Binary files /dev/null and b/inst/app/www/plots/jurienbay_UVC_total_abundance.png differ diff --git a/inst/app/www/plots/lalang-garram_stereo-ROVs_total_abundance.png b/inst/app/www/plots/lalang-garram_stereo-ROVs_total_abundance.png new file mode 100644 index 0000000..7e51457 Binary files /dev/null and b/inst/app/www/plots/lalang-garram_stereo-ROVs_total_abundance.png differ diff --git a/inst/app/www/plots/marmion_stereo-DOVs_total_abundance.png b/inst/app/www/plots/marmion_stereo-DOVs_total_abundance.png new file mode 100644 index 0000000..349ccb5 Binary files /dev/null and b/inst/app/www/plots/marmion_stereo-DOVs_total_abundance.png differ diff --git a/inst/app/www/plots/montebelloislands_stereo-DOVs_total_abundance.png b/inst/app/www/plots/montebelloislands_stereo-DOVs_total_abundance.png new file mode 100644 index 0000000..5a1a4dd Binary files /dev/null and b/inst/app/www/plots/montebelloislands_stereo-DOVs_total_abundance.png differ diff --git a/inst/app/www/plots/ningaloo_stereo-BRUVs_total_abundance.png b/inst/app/www/plots/ningaloo_stereo-BRUVs_total_abundance.png new file mode 100644 index 0000000..b581763 Binary files /dev/null and b/inst/app/www/plots/ningaloo_stereo-BRUVs_total_abundance.png differ diff --git a/inst/app/www/plots/ningaloo_stereo-DOVs_total_abundance.png b/inst/app/www/plots/ningaloo_stereo-DOVs_total_abundance.png new file mode 100644 index 0000000..b581763 Binary files /dev/null and b/inst/app/www/plots/ningaloo_stereo-DOVs_total_abundance.png differ diff --git a/inst/app/www/plots/rottnest_stereo-BRUVs_total_abundance.png b/inst/app/www/plots/rottnest_stereo-BRUVs_total_abundance.png new file mode 100644 index 0000000..bb0c6ec Binary files /dev/null and b/inst/app/www/plots/rottnest_stereo-BRUVs_total_abundance.png differ diff --git a/inst/app/www/plots/rottnest_stereo-DOVs_total_abundance.png b/inst/app/www/plots/rottnest_stereo-DOVs_total_abundance.png new file mode 100644 index 0000000..bb0c6ec Binary files /dev/null and b/inst/app/www/plots/rottnest_stereo-DOVs_total_abundance.png differ diff --git a/inst/app/www/plots/rowleyshoals_stereo-DOVs_total_abundance.png b/inst/app/www/plots/rowleyshoals_stereo-DOVs_total_abundance.png new file mode 100644 index 0000000..55d186b Binary files /dev/null and b/inst/app/www/plots/rowleyshoals_stereo-DOVs_total_abundance.png differ diff --git a/inst/app/www/plots/sharkbay_stereo-BRUVs_total_abundance.png b/inst/app/www/plots/sharkbay_stereo-BRUVs_total_abundance.png new file mode 100644 index 0000000..6bae972 Binary files /dev/null and b/inst/app/www/plots/sharkbay_stereo-BRUVs_total_abundance.png differ diff --git a/inst/app/www/plots/sharkbay_stereo-DOVs_total_abundance.png b/inst/app/www/plots/sharkbay_stereo-DOVs_total_abundance.png new file mode 100644 index 0000000..6bae972 Binary files /dev/null and b/inst/app/www/plots/sharkbay_stereo-DOVs_total_abundance.png differ diff --git a/inst/app/www/plots/shoalwaterislands_stereo-DOVs_total_abundance.png b/inst/app/www/plots/shoalwaterislands_stereo-DOVs_total_abundance.png new file mode 100644 index 0000000..5b2cf13 Binary files /dev/null and b/inst/app/www/plots/shoalwaterislands_stereo-DOVs_total_abundance.png differ