Skip to content

Commit

Permalink
Merge pull request #480 from USEPA/473-tada_twocharacteristicscatterp…
Browse files Browse the repository at this point in the history
…lot-legend-should-not-include-fraction-andor-speciation-if-they-are-na

473 tada twocharacteristicscatterplot legend should not include fraction andor speciation if they are na
  • Loading branch information
cristinamullin authored Jun 13, 2024
2 parents 0198934 + 2178ddd commit 3aeacbe
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions R/Figures.R
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,10 @@ TADA_TwoCharacteristicScatterplot <- function(.data, id_cols = "TADA.ComparableD
showgrid = FALSE, tickcolor = "black"
),
yaxis = list(
title = paste0(param1$TADA.CharacteristicName[1], " ", param1$TADA.ResultMeasure.MeasureUnitCode[1]),
title = stringr::str_remove_all(stringr::str_remove_all(
stringr::str_remove_all(paste0(param1$TADA.CharacteristicName[1], " ", param1$TADA.ResultMeasure.MeasureUnitCode[1]), stringr::fixed(" (NA)")),
stringr::fixed("NA ")
), stringr::fixed(" NA")),
titlefont = list(size = 16, family = "Arial"),
tickfont = list(size = 16, family = "Arial"),
hoverformat = ",.4r", linecolor = "black", rangemode = "tozero",
Expand All @@ -928,7 +931,10 @@ TADA_TwoCharacteristicScatterplot <- function(.data, id_cols = "TADA.ComparableD
yaxis2 = list(
side = "right",
overlaying = "y",
title = paste0(param2$TADA.CharacteristicName[1], " ", param2$TADA.ResultMeasure.MeasureUnitCode[1]),
title = stringr::str_remove_all(stringr::str_remove_all(
stringr::str_remove_all(paste0(param2$TADA.CharacteristicName[1], " ", param2$TADA.ResultMeasure.MeasureUnitCode[1]), stringr::fixed(" (NA)")),
stringr::fixed("NA ")
), stringr::fixed(" NA")),
titlefont = list(size = 16, family = "Arial"),
tickfont = list(size = 16, family = "Arial"),
hoverformat = ",.4r", linecolor = "black", rangemode = "tozero",
Expand All @@ -951,11 +957,14 @@ TADA_TwoCharacteristicScatterplot <- function(.data, id_cols = "TADA.ComparableD
data = param1,
x = ~ as.Date(ActivityStartDate),
y = ~TADA.ResultMeasureValue,
name = paste0(
name = stringr::str_remove_all(stringr::str_remove_all(
stringr::str_remove_all(paste0(
param1$TADA.ResultSampleFractionText, " ",
param1$TADA.CharacteristicName, " ",
param1$TADA.MethodSpeciationName
),
), stringr::fixed(" (NA)")),
stringr::fixed("NA ")
), stringr::fixed(" NA")),
marker = list(
size = 10,
color = tada.pal[5],
Expand Down Expand Up @@ -992,11 +1001,14 @@ TADA_TwoCharacteristicScatterplot <- function(.data, id_cols = "TADA.ComparableD
data = param2,
x = ~ as.Date(ActivityStartDate),
y = ~TADA.ResultMeasureValue,
name = paste0(
param2$TADA.ResultSampleFractionText, " ",
param2$TADA.CharacteristicName, " ",
param2$TADA.MethodSpeciationName
),
name = stringr::str_remove_all(stringr::str_remove_all(
stringr::str_remove_all(paste0(
param2$TADA.ResultSampleFractionText, " ",
param2$TADA.CharacteristicName, " ",
param2$TADA.MethodSpeciationName
), stringr::fixed(" (NA)")),
stringr::fixed("NA ")
), stringr::fixed(" NA")),
marker = list(
size = 10, color = tada.pal[3],
line = list(color = tada.pal[12], width = 2)
Expand Down

0 comments on commit 3aeacbe

Please sign in to comment.