Skip to content

Commit

Permalink
got the app working again woooo
Browse files Browse the repository at this point in the history
  • Loading branch information
BrookeGibbons committed Oct 26, 2023
1 parent a60bcb0 commit 7ccf5b9
Show file tree
Hide file tree
Showing 30 changed files with 50 additions and 41 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
81 changes: 46 additions & 35 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ----
Expand Down
4 changes: 3 additions & 1 deletion R/generate_plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion R/run_app.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 0 additions & 2 deletions app.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7ccf5b9

Please sign in to comment.