From 2161bb25c4c5b416fb059482f03d38602dc28c54 Mon Sep 17 00:00:00 2001 From: fawda123 Date: Wed, 6 Dec 2023 07:24:39 -0500 Subject: [PATCH] fix to show_sedimentalratio legend to remove extra text --- DESCRIPTION | 4 ++-- R/show_sedimentalratio.R | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9606eb37..37432667 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tbeptools Title: Data and Indicators for the Tampa Bay Estuary Program -Version: 2.0.1.9013 -Date: 2023-09-14 +Version: 2.0.1.9014 +Date: 2023-12-06 Authors@R: c( person(given = "Marcus", family = "Beck", diff --git a/R/show_sedimentalratio.R b/R/show_sedimentalratio.R index 04522bb8..9b560d69 100644 --- a/R/show_sedimentalratio.R +++ b/R/show_sedimentalratio.R @@ -173,7 +173,8 @@ show_sedimentalratio <- function(sedimentdata, param, yrrng = c(1993, 2021), bay } # plotly - if(plotly) + if(plotly){ + p <- plotly::ggplotly(p, width = width, height = height) %>% plotly::config( toImageButtonOptions = list( @@ -182,6 +183,13 @@ show_sedimentalratio <- function(sedimentdata, param, yrrng = c(1993, 2021), bay ) ) + # remove extra text from legend + for(i in 1:length(p$x$data)){ + p$x$data[[i]]$name <- gsub('^\\(|,1,NA\\)$|,1\\)$', '', p$x$data[[i]]$name) + } + + } + return(p) }