Skip to content

Commit

Permalink
Merge pull request bcgov#35 from poissonconsulting/dev
Browse files Browse the repository at this point in the history
Updates to app
  • Loading branch information
atillmanns authored Aug 10, 2023
2 parents d19a83d + 89a7209 commit 17f0f81
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 40 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinywqbench
Title: R Shiny App to Calculates Aquatic Life Benchmarks
Version: 0.1.0
Version: 0.1.0.9000
Authors@R: c(
person("Ayla", "Pearson", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0001-7388-1222")),
Expand All @@ -23,6 +23,7 @@ Imports:
ggplot2,
knitr,
markdown,
pkgload,
readr,
rlang,
rmarkdown,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export(run_wqbench_app)
import(shiny)
importFrom(knitr,kable)
importFrom(markdown,markdownToHTML)
importFrom(pkgload,load_all)
importFrom(rlang,.data)
7 changes: 5 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<!-- NEWS.md is maintained by https://cynkra.github.io/fledge, do not edit -->

# shinywqbench 1.0.0
# shinywqbench (development version)

- App is fully functional
- Updating title, adding instructions to data tab, updating user and about tabs

# shinywqbench 0.1.0

- App is fully functional

# shinywqbench 0.0.0.9000

Expand Down
2 changes: 1 addition & 1 deletion R/app-ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ app_ui <- function() {
shinyjs::useShinyjs(),
waiter::useWaiter(),
navbarPage(
title = "Aquatic Life Water Quality Benchmark Generator - DRAFT",
title = "Emergent Contaminant Aquatic Life Benchmarks - DRAFT",
selected = "tab1",
id = "navbarID",
tabPanel(
Expand Down
169 changes: 137 additions & 32 deletions R/mod-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,61 @@
mod_data_ui <- function(id, label = "data") {
ns <- NS(id)

sidebarLayout(
sidebarPanel(
tagList(
radioButtons(
ns("chem_type"),
label = "Select chemical by",
choices = c("Name", "CAS Registry Number (without dashes)"),
selected = "Name",
inline = TRUE
),
shinyjs::hidden(
div(
id = ns("div_name"),
selectizeInput(
ns("select_chem_name"),
label = "",
choices = NULL
),
)
),
shinyjs::hidden(
div(
id = ns("div_cas"),
selectizeInput(
ns("select_cas_num"),
label = "",
choices = NULL,
selected = NULL
fluidRow(
column(
4,
wellPanel(
tagList(
radioButtons(
ns("chem_type"),
label = "Select chemical by",
choices = c("Name", "CAS Registry Number (without dashes)"),
selected = "Name",
inline = TRUE
),
shinyjs::hidden(
div(
id = ns("div_name"),
selectizeInput(
ns("select_chem_name"),
label = "",
choices = NULL
),
)
),
shinyjs::hidden(
div(
id = ns("div_cas"),
selectizeInput(
ns("select_cas_num"),
label = "",
choices = NULL,
selected = NULL
)
)
)
)
),
actionButton(ns("run"), "Run"),
),
actionButton(ns("run"), "Run"),
wellPanel(
p("Select a chemical by name or with the CAS registry number (without dashes) by using the radio buttons."),
p("1. To clear a selection, hit the backspace button in the input field."),
p("2. If you are unable to find the chemical by name try the CAS number."),
p(
"3. You can use the",
a("CompTox Chemicals Dashboard", href = "https://comptox.epa.gov/dashboard/"),
"maintained by the US EPA to look up a CAS number."
),
p(
"4. The",
a("CompTox Chemicals Dashboard", href = "https://comptox.epa.gov/dashboard/"),
"is also helpful to look up synonyms. Many chemicals have multiple names."
),
p("Once a chemical has been selected, hit the Run button."),
)
),
mainPanel(
column(
8,
tabsetPanel(
tabPanel(
title = "1.1 Data Review",
Expand Down Expand Up @@ -86,7 +106,92 @@ mod_data_ui <- function(id, label = "data") {
)
)
)
)

)


# sidebarLayout(
# sidebarPanel(
#
# fluidRow(
# column(
# width = 1
# tagList(
# radioButtons(
# ns("chem_type"),
# label = "Select chemical by",
# choices = c("Name", "CAS Registry Number (without dashes)"),
# selected = "Name",
# inline = TRUE
# ),
# shinyjs::hidden(
# div(
# id = ns("div_name"),
# selectizeInput(
# ns("select_chem_name"),
# label = "",
# choices = NULL
# ),
# )
# ),
# shinyjs::hidden(
# div(
# id = ns("div_cas"),
# selectizeInput(
# ns("select_cas_num"),
# label = "",
# choices = NULL,
# selected = NULL
# )
# )
# )
# ),
# actionButton(ns("run"), "Run"),
# ),
# column(
# tabPanel("Instructions here"),
# ),
# ),
# ),
#
#mainPanel(
# tabsetPanel(
# tabPanel(
# title = "1.1 Data Review",
# well_panel(
# inline(uiOutput(ns("download_raw"))),
# inline(uiOutput(ns("button_select"))),
# br(),
# h3(uiOutput(ns("ui_text_1"))),
# br(),
# br(),
# uiOutput(ns("ui_table_selected"))
# )
# ),
# tabPanel(
# title = "1.2 View Plot",
# well_panel(
# uiOutput(ns("download_plot")),
# br(),
# h3(uiOutput(ns("ui_text_2"))),
# br(),
# br(),
# uiOutput(ns("ui_plot"))
# )
# ),
# tabPanel(
# title = "1.3 Aggregated Data",
# well_panel(
# uiOutput(ns("download_aggregated")),
# br(),
# h3(uiOutput(ns("ui_text_3"))),
# br(),
# br(),
# uiOutput(ns("ui_table_aggregated"))
# )
# )
# )
# )
)
}

Expand Down
1 change: 1 addition & 0 deletions R/namespace.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
#' @importFrom rlang .data
#' @importFrom knitr kable
#' @importFrom markdown markdownToHTML
#' @importFrom pkgload load_all
NULL
10 changes: 8 additions & 2 deletions inst/extdata/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@
# limitations under the License.
-->

**This app is under development and is being shared for testing purposes only.**
The purpose of this app is to allow the user to calculate aquatic life benchmarks for emergent contaminants when no water quality guidelines are available.
Although these benchmarks follow methods similar to those outlined in the [BC WQG derivation protocol](https://www2.gov.bc.ca/assets/gov/environment/air-land-water/water/waterquality/water-quality-guidelines/derivation-protocol/bc_wqg_aquatic_life_derivation_protocol.pdf), many steps have been omitted including data quality screening and expert review and therefore these benchmarks are not equivalent to water quality guidelines.
Rather the purpose of the benchmarks is to support the assessment of monitoring data and the potential for a chemical to impact the aquatic environment.

This app calculates aquatic life benchmarks for use when interpreting monitoring results when no water quality guidelines is available. The app requires the user to first screen the data and then follow the necessary steps to calculate a benchmark.
If you have any feedback or comments on this app, please email them to [email protected] For further information on this app, please see the draft overview:
Tillmanns, A.R. and Pearson, A. 2023. DRAFT wqbench: A Tool for Calculating Emergent Contaminant Aquatic Life Benchmarks. Ministry of Water, Land and Resource Stewardship. Province of British Columbia, Victoria.




The app automatically completes the following steps:

Expand Down
2 changes: 0 additions & 2 deletions inst/extdata/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# limitations under the License.
-->


This app **generates aquatic life water quality benchmarks**.
The app is built from the R package [wqbench](https://github.com/bcgov/wqbench), and shares the same functionality.

## How to Use the shinywqbench App
Expand Down

0 comments on commit 17f0f81

Please sign in to comment.