Skip to content

Commit

Permalink
fixing build issue with show_hmpreport
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Jun 10, 2024
1 parent bcdd8b9 commit db14ad9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: tbeptools
Title: Data and Indicators for the Tampa Bay Estuary Program
Version: 2.0.1.9023
Date: 2024-05-31
Version: 2.0.1.9024
Date: 2024-06-10
Authors@R: c(
person(given = "Marcus",
family = "Beck",
Expand Down Expand Up @@ -57,7 +57,7 @@ Imports:
dataRetrieval,
dplyr,
flextable,
ggplot2,
ggplot2 (>= 3.2.0),
httr,
jsonlite,
leaflet,
Expand Down
3 changes: 2 additions & 1 deletion R/globalVariables.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ globalVariables(c("Chlorophyll_aQ", "Latitude", "Longitude", "SampleTime", "Samp
"indnm", "brk", "cls", "conc", "exced", "gmean", "MWQA", "station_tot",
"sumgt400", "yearfac", "nyrs", "ActivityDepthHeightMeasure.MeasureUnitCode",
"ActivityDepthHeightMeasure.MeasureValue", "chla_target", "chla_val",
"la_target", "la_val", "MonitoringLocationTypeName", "loadest", "out1"))
"la_target", "la_val", "MonitoringLocationTypeName", "loadest", "out1",
"v", "z", "<<-"))

#' @importFrom grDevices rgb
NULL
Expand Down
26 changes: 13 additions & 13 deletions R/show_hmpreport.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ show_hmpreport <- function(acres, subtacres, hmptrgs, typ, twocol = FALSE, strat
draw_panel = function(data, panel_scales, coord) {
coords <- coord$transform(data, panel_scales)
grobs <- mapply(my_custom_grob_up, coords$x, coords$y, coords$size, coords$colour, SIMPLIFY = FALSE)
grid::grobTree(do.call(gList, grobs))
grid::grobTree(do.call(grid::gList, grobs))
},
draw_key = draw_key_point
)
Expand Down Expand Up @@ -251,13 +251,13 @@ show_hmpreport <- function(acres, subtacres, hmptrgs, typ, twocol = FALSE, strat
draw_panel = function(data, panel_scales, coord) {
coords <- coord$transform(data, panel_scales)
grobs <- mapply(my_custom_grob_down, coords$x, coords$y, coords$size, coords$colour, SIMPLIFY = FALSE)
grid::grobTree(do.call(gList, grobs))
grid::grobTree(do.call(grid::gList, grobs))
},
draw_key = draw_key_point
)

# legend drawing function up arrow
draw_key_up <- function(data, params, size){
draw_key_up <<- function(data, params, size){
params$arrow$length <- grid::unit(0.35, 'cm')
grid::segmentsGrob(0.1, 0.1, 0.9, 0.9,
gp = grid::gpar(col = 'black', fill = 'black', lwd = 2, lineend = "butt"),
Expand All @@ -266,7 +266,7 @@ show_hmpreport <- function(acres, subtacres, hmptrgs, typ, twocol = FALSE, strat
}

# legend drawing function down arrow
draw_key_down<- function(data, params, size){
draw_key_down <<- function(data, params, size){
params$arrow$length <- grid::unit(0.35, 'cm')
grid::segmentsGrob(0.1, 0.9, 0.9, 0.1,
gp = grid::gpar(col = 'black', fill = 'black', lwd = 2, lineend = "butt"),
Expand All @@ -289,16 +289,16 @@ show_hmpreport <- function(acres, subtacres, hmptrgs, typ, twocol = FALSE, strat
ggplot2::scale_colour_manual(values = cols) +
ggplot2::guides(color = ggplot2::guide_legend(override.aes = list(alpha = 1, shape = 15, size = 6))) +
ggplot2::geom_segment(data = toplo,
ggplot2::aes(x = metric, xend = metric, y = yearfac, yend = yearfac, linetype = z),
arrow = grid::arrow(length = grid::unit(0.25, 'cm'), type = 'open', angle = 45),
size = 0.7, alpha = 0,
key_glyph = "up"
) +
ggplot2::aes(x = metric, xend = metric, y = yearfac, yend = yearfac, linetype = z),
arrow = grid::arrow(length = grid::unit(0.25, 'cm'), type = 'open', angle = 45),
size = 0.7, alpha = 0,
key_glyph = "up"
) +
ggplot2::geom_segment(data = toplo,
ggplot2::aes(x = metric, xend = metric, y = yearfac, yend = yearfac, linetype = v),
arrow = grid::arrow(length = grid::unit(0.25, 'cm'), type = 'open', angle = 45),
size = 0.7, alpha = 0,
key_glyph = "down"
ggplot2::aes(x = metric, xend = metric, y = yearfac, yend = yearfac, linetype = v),
arrow = grid::arrow(length = grid::unit(0.25, 'cm'), type = 'open', angle = 45),
size = 0.7, alpha = 0,
key_glyph = "down"
) +
labs(
linetype = NULL,
Expand Down

0 comments on commit db14ad9

Please sign in to comment.