Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes scatterplot bug #121

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions R/mod_figures.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ mod_figures_server <- function(id, tadat) {
# this line adds a new column to the dataset of concatenated values of all of the columns selected by the user in the drop down above.
depthcols <- names(tadat$raw)[grepl("DepthHeightMeasure", names(tadat$raw))]
depthcols <- depthcols[grepl("TADA.", depthcols)]
selcols <- c("OrganizationFormalName", "ResultIdentifier", "groupname", "MonitoringLocationIdentifier", "MonitoringLocationName", "MonitoringLocationTypeName", "TADA.LatitudeMeasure", "TADA.LongitudeMeasure", "TADA.ResultMeasureValue", "TADA.ResultMeasure.MeasureUnitCode", "ActivityRelativeDepthName", "ActivityStartDate", "ActivityStartDateTime", depthcols)
selcols <- c("OrganizationFormalName", "ResultIdentifier", "groupname", "MonitoringLocationIdentifier", "MonitoringLocationName", "MonitoringLocationTypeName", "TADA.LatitudeMeasure", "TADA.LongitudeMeasure", "TADA.ResultMeasureValue", "TADA.ResultMeasure.MeasureUnitCode", "ActivityRelativeDepthName", "ActivityStartDate", "ActivityStartDateTime", "TADA.ActivityMediaName", "ActivityMediaSubdivisionName", depthcols)

react$dat <- tadat$raw %>%
dplyr::filter(TADA.Remove == FALSE, !is.na(TADA.ResultMeasureValue)) %>%
Expand Down Expand Up @@ -239,7 +239,7 @@ mod_figures_server <- function(id, tadat) {
)
})

# when the Go button is pushed to generate plots, this ensure the plot data is filtered to the selected sites (or all sites)
# when the Go button is pushed to generate plots, this ensures the plot data is filtered to the selected sites (or all sites)
shiny::observeEvent(input$selsitesgo, {
if (all(input$selsites1 == "All sites")) {
react$plotdata <- react$plotdataset
Expand Down Expand Up @@ -323,7 +323,7 @@ mod_figures_server <- function(id, tadat) {
output$scatter2 <- plotly::renderPlotly({
shiny::req(react$plotdata)
if (length(unique(react$plotdata$groupname)) > 1) {
suppressWarnings(TADA::TADA_TwoCharacteristicScatterplot(react$plotdata, id_col = "groupname", groups = unique(react$plotdata$groupname)))
suppressWarnings(TADA::TADA_TwoCharacteristicScatterplot(react$plotdata, id_cols = "groupname", groups = unique(react$plotdata$groupname)))
}
})
})
Expand Down