diff --git a/DESCRIPTION b/DESCRIPTION index e8bc476..af64c1a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: GiottoVisuals Title: Visuals for the Giotto spatial biology analysis ecosystem -Version: 0.2.4 +Version: 0.2.5 Authors@R: c( person("Ruben", "Dries", email = "rubendries@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-7650-7754")), diff --git a/NEWS.md b/NEWS.md index cc7ab2e..8c957d7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ -# GiottoVisuals 0.2.4 +# GiottoVisuals 0.2.5 + + + +# GiottoVisuals 0.2.4 (2024/07/26) ## enhancements - `giottoLargeImage` `max_window` and `colors` slot info is now followed during ggplot plotting diff --git a/R/aux_output.R b/R/aux_output.R index 24a3031..cd05191 100644 --- a/R/aux_output.R +++ b/R/aux_output.R @@ -25,9 +25,9 @@ #' @examples #' g <- GiottoData::loadGiottoMini("vizgen") #' g_spatplot <- spatPlot2D(g, return_plot = TRUE) -#' +#' #' plot_output_handler(g, plot_object = g_spatplot, save_plot = FALSE) -#' +#' #' @export plot_output_handler <- function( gobject, @@ -44,18 +44,10 @@ plot_output_handler <- function( # IF setting is NULL then the appropriate setting from gobject instructions # will be checked and used. # IF setting is NOT NULL then the provided value will be used directly. - show_plot <- ifelse(is.null(show_plot), - readGiottoInstructions(gobject, param = "show_plot"), - show_plot - ) - save_plot <- ifelse(is.null(save_plot), - readGiottoInstructions(gobject, param = "save_plot"), - save_plot - ) - return_plot <- ifelse(is.null(return_plot), - readGiottoInstructions(gobject, param = "return_plot"), - return_plot - ) + show_plot <- show_plot %null% instructions(gobject, param = "show_plot") + save_plot <- save_plot %null% instructions(gobject, param = "save_plot") + return_plot <- return_plot %null% + instructions(gobject, param = "return_plot") ## print plot ## @@ -67,7 +59,7 @@ plot_output_handler <- function( if (save_plot) { checkmate::assert_character(default_save_name) checkmate::assert_list(save_param) - + do.call( "all_plots_save_function", c( @@ -103,9 +95,9 @@ plot_output_handler <- function( # checkmate::assert_class(gobject, 'giotto') # checkmate::assert_character(default_save_name) # checkmate::assert_list(save_param) -# +# # instr = instructions(gobject) -# +# # ## output settings detection ## # # IF setting is NA then the appropriate setting from gobject instructions # # will be checked and used. @@ -121,12 +113,12 @@ plot_output_handler <- function( # plot_output_handler_do = function(gplot_out) { # checkmate::assert_class(gplot_out, 'giottoPlotOutput') -# +# # ## print plot ## # if(gplot_out$show_plot) { # print(gplot_out$plot_object) # } -# +# # ## save plot ## # if(gplot_out$save_plot) { # do.call('all_plots_save_function', @@ -136,7 +128,7 @@ plot_output_handler <- function( # save_param) # ) # } -# +# # ## return plot ## # if(return_plot) { # invisible(return(plot_object))