From 1e9b9c69f00cd1872f71bb7a4e4b91e0ae6bda55 Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Fri, 22 Dec 2023 15:35:26 -0800 Subject: [PATCH 01/14] Add option suppress_default_hovertext --- R/heatmaply.R | 5 +++++ R/plots.R | 32 ++++++++++++++++++++++---------- man/heatmaply.Rd | 4 ++++ 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/R/heatmaply.R b/R/heatmaply.R index d1d6203..765e912 100644 --- a/R/heatmaply.R +++ b/R/heatmaply.R @@ -571,6 +571,7 @@ heatmaply.default <- function(x, label_format_fun = function(...) format(..., digits = 4), labRow = NULL, labCol = NULL, custom_hovertext = NULL, + suppress_default_hovertext = F, col = NULL, dend_hoverinfo = TRUE, side_color_colorbar_len = 0.3, @@ -757,6 +758,7 @@ heatmaply.default <- function(x, scale = scale, na.rm = na.rm, custom_hovertext = custom_hovertext, + suppress_default_hovertext = suppress_default_hovertext, labRow = labRow, labCol = labCol, ... @@ -808,6 +810,7 @@ heatmaply.default <- function(x, point_size_name = point_size_name, label_format_fun = label_format_fun, dend_hoverinfo = dend_hoverinfo, + suppress_default_hovertext = suppress_default_hovertext, side_color_colorbar_len = side_color_colorbar_len, plotly_source = plotly_source, height = height, @@ -887,6 +890,7 @@ heatmaply.heatmapr <- function(x, point_size_name = "Point size", label_format_fun = function(...) format(..., digits = 4), custom_hovertext = x[["matrix"]][["custom_hovertext"]], + suppress_default_hovertext = F, dend_hoverinfo = TRUE, side_color_colorbar_len = 0.3, plotly_source = "A", @@ -1017,6 +1021,7 @@ heatmaply.heatmapr <- function(x, point_size_name = point_size_name, label_format_fun = label_format_fun, custom_hovertext = custom_hovertext, + suppress_default_hovertext = suppress_default_hovertext, showticklabels = showticklabels ) } else if (plot_method == "plotly") { diff --git a/R/plots.R b/R/plots.R index 463d8f4..9293771 100644 --- a/R/plots.R +++ b/R/plots.R @@ -60,11 +60,14 @@ ggplot_heatmap <- function(xx, col <- label_names[[2]] val <- label_names[[3]] - mdf[["text"]] <- paste0( - row, ": ", mdf[[1]], "
", - col, ": ", mdf[[2]], "
", - val, ": ", label_format_fun(mdf[[3]]) - ) + if(!suppress_default_hovertext) + { + mdf[["text"]] <- paste0( + row, ": ", mdf[[1]], "
", + col, ": ", mdf[[2]], "
", + val, ": ", label_format_fun(mdf[[3]]) + ) + } if (type == "heatmap") { geom <- "geom_tile" @@ -77,10 +80,13 @@ ggplot_heatmap <- function(xx, geom <- "geom_point" geom_args <- list() if (!is.null(point_size_mat)) { - mdf[["text"]] <- paste( - mdf[["text"]], "
", - point_size_name, ": ", label_format_fun(mdf[[4]]) - ) + if(!suppress_default_hovertext) + { + mdf[["text"]] <- paste( + mdf[["text"]], "
", + point_size_name, ": ", label_format_fun(mdf[[4]]) + ) + } aes_mapping <- aes( color = .data[[val]], text = .data$text, @@ -95,7 +101,13 @@ ggplot_heatmap <- function(xx, } } if (!is.null(custom_hovertext)) { - mdf[["text"]] <- paste0(mdf[["text"]], "
", custom_hovertext) + if(!suppress_default_hovertext) + { + mdf[["text"]] <- paste0(mdf[["text"]], "
", custom_hovertext) + } else + { + mdf[["text"]] <- reshape2::melt(as.matrix(custom_hovertext))[[3]] + } } geom_args[["mapping"]] <- aes_mapping diff --git a/man/heatmaply.Rd b/man/heatmaply.Rd index 584bd61..4d2df0f 100644 --- a/man/heatmaply.Rd +++ b/man/heatmaply.Rd @@ -474,6 +474,10 @@ backward compatibility with gplots::heatmap.2.} If plot_method is "plotly" then just this text is displayed; if plot_method if "ggplot" then it is appended to the existing text.} +\item{suppress_default_hovertext}{Logical (FALSE) indicating whether to hide the +default hovertext for plot_method = "ggplot" of row, column, value, and Point +size.} + \item{dend_hoverinfo}{Boolean value which controls whether mouseover text is shown for the row and column dendrograms.} From fa134049d04f742b49342e4dc3c7691d6b0d8ca5 Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sun, 24 Dec 2023 10:00:08 -0800 Subject: [PATCH 02/14] Add suppress hovertext arg to ggplot_heatmap --- R/plots.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/plots.R b/R/plots.R index 9293771..81e1132 100644 --- a/R/plots.R +++ b/R/plots.R @@ -24,6 +24,7 @@ ggplot_heatmap <- function(xx, point_size_name = "Point size", label_format_fun = function(...) format(..., digits = 4), custom_hovertext = NULL, + suppress_default_hovertext = FALSE, showticklabels = c(TRUE, TRUE), ...) { theme_clear_grid_heatmap <- theme( From efb3cd7c5dd7e0bb8b12fe427a749076e0b0c176 Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sat, 13 Jul 2024 10:19:44 -0700 Subject: [PATCH 03/14] Style changes and invert if/else --- R/heatmaply.R | 2 +- R/plots.R | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/R/heatmaply.R b/R/heatmaply.R index 765e912..a49a88a 100644 --- a/R/heatmaply.R +++ b/R/heatmaply.R @@ -890,7 +890,7 @@ heatmaply.heatmapr <- function(x, point_size_name = "Point size", label_format_fun = function(...) format(..., digits = 4), custom_hovertext = x[["matrix"]][["custom_hovertext"]], - suppress_default_hovertext = F, + suppress_default_hovertext = FALSE, dend_hoverinfo = TRUE, side_color_colorbar_len = 0.3, plotly_source = "A", diff --git a/R/plots.R b/R/plots.R index 81e1132..74a8dd6 100644 --- a/R/plots.R +++ b/R/plots.R @@ -61,8 +61,7 @@ ggplot_heatmap <- function(xx, col <- label_names[[2]] val <- label_names[[3]] - if(!suppress_default_hovertext) - { + if(!suppress_default_hovertext) { mdf[["text"]] <- paste0( row, ": ", mdf[[1]], "
", col, ": ", mdf[[2]], "
", @@ -102,12 +101,10 @@ ggplot_heatmap <- function(xx, } } if (!is.null(custom_hovertext)) { - if(!suppress_default_hovertext) - { - mdf[["text"]] <- paste0(mdf[["text"]], "
", custom_hovertext) - } else - { + if(suppress_default_hovertext) { mdf[["text"]] <- reshape2::melt(as.matrix(custom_hovertext))[[3]] + } else { + mdf[["text"]] <- paste0(mdf[["text"]], "
", custom_hovertext) } } geom_args[["mapping"]] <- aes_mapping From 6ce178e799985082979111d895ddf1cbf5ee5a77 Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sat, 13 Jul 2024 10:31:51 -0700 Subject: [PATCH 04/14] revert if/else switch --- R/plots.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/plots.R b/R/plots.R index 74a8dd6..7b0a4a2 100644 --- a/R/plots.R +++ b/R/plots.R @@ -101,10 +101,10 @@ ggplot_heatmap <- function(xx, } } if (!is.null(custom_hovertext)) { - if(suppress_default_hovertext) { - mdf[["text"]] <- reshape2::melt(as.matrix(custom_hovertext))[[3]] - } else { + if(!suppress_default_hovertext) { mdf[["text"]] <- paste0(mdf[["text"]], "
", custom_hovertext) + } else { + mdf[["text"]] <- reshape2::melt(as.matrix(custom_hovertext))[[3]] } } geom_args[["mapping"]] <- aes_mapping From 09ed7bb846af85e391b4904aa2558af8a7169848 Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sat, 13 Jul 2024 11:00:42 -0700 Subject: [PATCH 05/14] Try fix for empty text slot with no custom and no default hovertext --- R/plots.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/R/plots.R b/R/plots.R index 7b0a4a2..403d252 100644 --- a/R/plots.R +++ b/R/plots.R @@ -61,12 +61,14 @@ ggplot_heatmap <- function(xx, col <- label_names[[2]] val <- label_names[[3]] - if(!suppress_default_hovertext) { + if (!suppress_default_hovertext) { mdf[["text"]] <- paste0( row, ": ", mdf[[1]], "
", col, ": ", mdf[[2]], "
", val, ": ", label_format_fun(mdf[[3]]) ) + } else { + mdf[["text"]] <- "" } if (type == "heatmap") { @@ -101,10 +103,10 @@ ggplot_heatmap <- function(xx, } } if (!is.null(custom_hovertext)) { - if(!suppress_default_hovertext) { - mdf[["text"]] <- paste0(mdf[["text"]], "
", custom_hovertext) - } else { + if (suppress_default_hovertext) { mdf[["text"]] <- reshape2::melt(as.matrix(custom_hovertext))[[3]] + } else { + mdf[["text"]] <- paste0(mdf[["text"]], "
", custom_hovertext) } } geom_args[["mapping"]] <- aes_mapping From 14fb1de1eaf7b978a3b69daeefbad98539b1decb Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sat, 13 Jul 2024 11:03:24 -0700 Subject: [PATCH 06/14] conform if style --- R/heatmaply.R | 6 +++--- R/heatmapr.R | 6 +++--- R/plots.R | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/R/heatmaply.R b/R/heatmaply.R index a49a88a..6a67394 100644 --- a/R/heatmaply.R +++ b/R/heatmaply.R @@ -643,8 +643,8 @@ heatmaply.default <- function(x, if (is.logical(dendrogram)) { # Using if and not ifelse to make sure the output is a "scalar". dendrogram <- if (dendrogram) "both" else "none" - # if(T) "both" else "none" - # if(F) "both" else "none" + # if (T) "both" else "none" + # if (F) "both" else "none" } dendrogram <- match.arg(dendrogram) @@ -1421,7 +1421,7 @@ heatmap_subplot_from_ggplotly <- function(p, px, py, pr, pc, # s <- subplot(plots, # nrows = nrows, - # widths = if(row_dend_left) rev(widths) else widths, + # widths = if (row_dend_left) rev(widths) else widths, # shareX = TRUE, shareY = TRUE, # titleX = titleX, titleY = titleY, # margin = subplot_margin, diff --git a/R/heatmapr.R b/R/heatmapr.R index c1492ae..f8ea1cb 100644 --- a/R/heatmapr.R +++ b/R/heatmapr.R @@ -232,7 +232,7 @@ heatmapr <- function(x, nr <- nrow(x) nc <- ncol(x) ### TODO: debating if to include this or not: - # if(nr <= 1 || nc <= 1) + # if (nr <= 1 || nc <= 1) # stop("`x' must have at least 2 rows and 2 columns") @@ -398,7 +398,7 @@ heatmapr <- function(x, # ---------------- # Due to the internal working of dendextend, in order to use it we first need # to populate the dendextend::dendextend_options() space: - # if(!missing(k_row) | !missing(k_col)) # Setting k_row and k_col to 1 by default + # if (!missing(k_row) | !missing(k_col)) # Setting k_row and k_col to 1 by default dendextend::assign_dendextend_options() if (is.dendrogram(Rowv)) { @@ -446,7 +446,7 @@ heatmapr <- function(x, ## Final touches before exporting the object ## ======================= - # if(!is.null(custom_hovertext) && !is.matrix(custom_hovertext)) { + # if (!is.null(custom_hovertext) && !is.matrix(custom_hovertext)) { if (is.data.frame(custom_hovertext)) { custom_hovertext <- as.matrix(custom_hovertext) } diff --git a/R/plots.R b/R/plots.R index 403d252..c50c267 100644 --- a/R/plots.R +++ b/R/plots.R @@ -82,7 +82,7 @@ ggplot_heatmap <- function(xx, geom <- "geom_point" geom_args <- list() if (!is.null(point_size_mat)) { - if(!suppress_default_hovertext) + if (!suppress_default_hovertext) { mdf[["text"]] <- paste( mdf[["text"]], "
", @@ -477,7 +477,7 @@ ggplot_side_color_plot <- function(df, ) ## Don't need this hack any more? - # if(original_dim[2] > 1) { + # if (original_dim[2] > 1) { text_element <- element_text(angle = text_angle, hjust = 1, size = fontsize) # } else text_element <- element_blank() From d5457bbae21ef0d08099fb2ea67ba94cc2530070 Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sat, 13 Jul 2024 11:14:29 -0700 Subject: [PATCH 07/14] Add Matt Simenc to DESCRIPTION as contributor --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index 62c1aa0..9e2fc23 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -9,6 +9,7 @@ Authors@R: c( person("Jonathan", "Sidi", email = "yonis@metrumrg.com", comment = "https://github.com/yonicd",role = "ctb"), person("Jaehyun", "Joo", comment = "https://github.com/jaehyunjoo",role = "ctb"), person("Yoav", "Benjamini", email = "ybenja@tau.ac.il",role = "ths")) + person("Mathew", "Simenc", role = "ctb", comment = "https://gitlab.com/mcsimenc, https://github.com/mcsimenc")) Description: Create interactive cluster 'heatmaps' that can be saved as a stand- alone HTML file, embedded in 'R Markdown' documents or in a 'Shiny' app, and available in the 'RStudio' viewer pane. Hover the mouse pointer over a cell to From fdca5057249435ae4c45c3377d058f1946e46bec Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sat, 13 Jul 2024 11:54:43 -0700 Subject: [PATCH 08/14] Fix DESCRIPTION, conform style, and improve consistency in logic --- DESCRIPTION | 2 +- R/heatmaply.R | 12 ++++++------ R/plots.R | 6 +++--- R/zzz.R | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9e2fc23..599b5ca 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -8,7 +8,7 @@ Authors@R: c( person("Alan", "O'Callaghan", comment = "https://github.com/Alanocallaghan",role = "aut"), person("Jonathan", "Sidi", email = "yonis@metrumrg.com", comment = "https://github.com/yonicd",role = "ctb"), person("Jaehyun", "Joo", comment = "https://github.com/jaehyunjoo",role = "ctb"), - person("Yoav", "Benjamini", email = "ybenja@tau.ac.il",role = "ths")) + person("Yoav", "Benjamini", email = "ybenja@tau.ac.il",role = "ths")), person("Mathew", "Simenc", role = "ctb", comment = "https://gitlab.com/mcsimenc, https://github.com/mcsimenc")) Description: Create interactive cluster 'heatmaps' that can be saved as a stand- alone HTML file, embedded in 'R Markdown' documents or in a 'Shiny' app, and diff --git a/R/heatmaply.R b/R/heatmaply.R index 6a67394..86ee300 100644 --- a/R/heatmaply.R +++ b/R/heatmaply.R @@ -427,12 +427,12 @@ #' #' #' # Example of removing labels and thus making the plot faster -#' heatmaply(iris, showticklabels = c(T, F), margins = c(80, 10)) +#' heatmaply(iris, showticklabels = c(TRUE, FALSE), margins = c(80, 10)) #' #' # this is what allows for a much larger matrix to be printed: #' set.seed(2017 - 05 - 18) #' large_x <- matrix(rnorm(19), 1000, 100) -#' heatmaply(large_x, dendrogram = F, showticklabels = F, margins = c(1, 1)) +#' heatmaply(large_x, dendrogram = FALSE, showticklabels = FALSE, margins = c(1, 1)) #' } heatmaply <- function(x, ...) { UseMethod("heatmaply") @@ -571,7 +571,7 @@ heatmaply.default <- function(x, label_format_fun = function(...) format(..., digits = 4), labRow = NULL, labCol = NULL, custom_hovertext = NULL, - suppress_default_hovertext = F, + suppress_default_hovertext = FALSE, col = NULL, dend_hoverinfo = TRUE, side_color_colorbar_len = 0.3, @@ -643,8 +643,8 @@ heatmaply.default <- function(x, if (is.logical(dendrogram)) { # Using if and not ifelse to make sure the output is a "scalar". dendrogram <- if (dendrogram) "both" else "none" - # if (T) "both" else "none" - # if (F) "both" else "none" + # if (TRUE) "both" else "none" + # if (FALSE) "both" else "none" } dendrogram <- match.arg(dendrogram) @@ -1213,7 +1213,7 @@ heatmaply.heatmapr <- function(x, title = main, # layout's title: /r/reference/#layout-title xaxis = list( # layout's xaxis is a named list. List of valid keys: /r/reference/#layout-xaxis title = xlab # xaxis's title: /r/reference/#layout-xaxis-title - # showgrid = T # xaxis's showgrid: /r/reference/#layout-xaxis-showgrid + # showgrid = TRUE # xaxis's showgrid: /r/reference/#layout-xaxis-showgrid ), yaxis = list( # layout's yaxis is a named list. List of valid keys: /r/reference/#layout-yaxis title = ylab # yaxis's title: /r/reference/#layout-yaxis-title diff --git a/R/plots.R b/R/plots.R index c50c267..f86af27 100644 --- a/R/plots.R +++ b/R/plots.R @@ -103,10 +103,10 @@ ggplot_heatmap <- function(xx, } } if (!is.null(custom_hovertext)) { - if (suppress_default_hovertext) { - mdf[["text"]] <- reshape2::melt(as.matrix(custom_hovertext))[[3]] - } else { + if (!suppress_default_hovertext) { mdf[["text"]] <- paste0(mdf[["text"]], "
", custom_hovertext) + } else { + mdf[["text"]] <- reshape2::melt(as.matrix(custom_hovertext))[[3]] } } geom_args[["mapping"]] <- aes_mapping diff --git a/R/zzz.R b/R/zzz.R index f41ea53..39d8dc2 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -250,7 +250,7 @@ heatmaplyWelcomeMessage <- function() { # # http://stackoverflow.com/questions/10330425/how-do-i-export-a-git-log-to-a-text-file # # http://stackoverflow.com/questions/3523534/good-ways-to-manage-a-changelog-using-git # # http://www.commandlinefu.com/commands/view/12420/generate-a-change-log-with-git -# shell("git log --decorate > ChangeLog", intern = T) +# shell("git log --decorate > ChangeLog", intern = TRUE) # Modify it using: http://git-scm.com/book/en/Git-Basics-Viewing-the-Commit-History # http://stackoverflow.com/questions/9007181/custom-log-format-omits-newline-at-end-of-output @@ -305,6 +305,6 @@ heatmaplyWelcomeMessage <- function() { # file.copy("NEWS", "NEWS.md",overwrite = TRUE) # devtools::check_win_devel() # pkgdown::build_home() -# pkgdown::build_site(run_dont_run = F) +# pkgdown::build_site(run_dont_run = FALSE) # pkgdown::build_news() # release() From 65baa46d0d08fa905b2f5d597118b945959f19b7 Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sat, 13 Jul 2024 12:48:10 -0700 Subject: [PATCH 09/14] Removed extra paren in DESCRIPTION file --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 599b5ca..0c43321 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -8,7 +8,7 @@ Authors@R: c( person("Alan", "O'Callaghan", comment = "https://github.com/Alanocallaghan",role = "aut"), person("Jonathan", "Sidi", email = "yonis@metrumrg.com", comment = "https://github.com/yonicd",role = "ctb"), person("Jaehyun", "Joo", comment = "https://github.com/jaehyunjoo",role = "ctb"), - person("Yoav", "Benjamini", email = "ybenja@tau.ac.il",role = "ths")), + person("Yoav", "Benjamini", email = "ybenja@tau.ac.il",role = "ths"), person("Mathew", "Simenc", role = "ctb", comment = "https://gitlab.com/mcsimenc, https://github.com/mcsimenc")) Description: Create interactive cluster 'heatmaps' that can be saved as a stand- alone HTML file, embedded in 'R Markdown' documents or in a 'Shiny' app, and From b91f7100318b95649e74263cc86d48e5d90a99fb Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sat, 13 Jul 2024 22:25:42 -0700 Subject: [PATCH 10/14] Added roxygen documentation for suppress_default_hovertext --- R/heatmaply.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/heatmaply.R b/R/heatmaply.R index 86ee300..eb56183 100644 --- a/R/heatmaply.R +++ b/R/heatmaply.R @@ -266,6 +266,10 @@ #' @param custom_hovertext Custom hovertext matrix (the same dimensions as the input). #' If plot_method is "plotly" then just this text is displayed; if plot_method #' if "ggplot" then it is appended to the existing text. +#' +#' @param suppress_default_hovertext Logical value determinine whether to suppress +#' the default hovertext (row, column, value). +#' #' @param label_format_fun Function to format hovertext (eg, #' \code{function(...) round(..., digits=3)} or #' \code{function(...) format(..., digits=3)} From 07a1baaa63f3cc1d2db81068ab56df6873e90e97 Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sun, 14 Jul 2024 11:49:16 -0700 Subject: [PATCH 11/14] Add @param for suppress_default_hovertext to heatmapr --- R/heatmapr.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/heatmapr.R b/R/heatmapr.R index f8ea1cb..0fc83c8 100644 --- a/R/heatmapr.R +++ b/R/heatmapr.R @@ -126,6 +126,8 @@ fix_not_all_unique <- function(x, ...) { #' "GW" (Gruvaeus and Wainer heuristic to optimize the Hamiltonian path length that is restricted by the dendrogram structure) #' @param point_size_mat A matrix of values which can be mapped to point size #' @param custom_hovertext Custom hovertext matrix (the same dimensions as the input). +#' @param suppress_default_hovertext Logical value determinine whether to suppress +#' the default hovertext (row, column, value). #' @param ... currently ignored #' #' @export From d7cb596af0619d0ade5a49700889c65af4174b34 Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sun, 14 Jul 2024 18:10:21 -0700 Subject: [PATCH 12/14] Added item to roxygen Rd documentation for suppress_default_hovertext and modified param descriptions in R files to match. --- R/heatmaply.R | 5 +++-- R/heatmapr.R | 7 +++++-- man/heatmaply.Rd | 2 ++ man/heatmapr.Rd | 6 ++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/R/heatmaply.R b/R/heatmaply.R index eb56183..159d289 100644 --- a/R/heatmaply.R +++ b/R/heatmaply.R @@ -267,8 +267,9 @@ #' If plot_method is "plotly" then just this text is displayed; if plot_method #' if "ggplot" then it is appended to the existing text. #' -#' @param suppress_default_hovertext Logical value determinine whether to suppress -#' the default hovertext (row, column, value). +#' @param suppress_default_hovertext Logical indicating whether to hide the +#' default hovertext for plot_method = "ggplot" of row, column, value, and Point +#' size. #' #' @param label_format_fun Function to format hovertext (eg, #' \code{function(...) round(..., digits=3)} or diff --git a/R/heatmapr.R b/R/heatmapr.R index 0fc83c8..c30409f 100644 --- a/R/heatmapr.R +++ b/R/heatmapr.R @@ -126,8 +126,11 @@ fix_not_all_unique <- function(x, ...) { #' "GW" (Gruvaeus and Wainer heuristic to optimize the Hamiltonian path length that is restricted by the dendrogram structure) #' @param point_size_mat A matrix of values which can be mapped to point size #' @param custom_hovertext Custom hovertext matrix (the same dimensions as the input). -#' @param suppress_default_hovertext Logical value determinine whether to suppress -#' the default hovertext (row, column, value). +#' +#' @param suppress_default_hovertext Logical indicating whether to hide the +#' default hovertext for plot_method = "ggplot" of row, column, value, and Point +#' size. +#' #' @param ... currently ignored #' #' @export diff --git a/man/heatmaply.Rd b/man/heatmaply.Rd index 4d2df0f..88c8c2e 100644 --- a/man/heatmaply.Rd +++ b/man/heatmaply.Rd @@ -101,6 +101,7 @@ heatmaply_cor(x, limits = c(-1, 1), colors = cool_warm, ...) labRow = NULL, labCol = NULL, custom_hovertext = NULL, + suppress_default_hovertext = FALSE, col = NULL, dend_hoverinfo = TRUE, side_color_colorbar_len = 0.3, @@ -166,6 +167,7 @@ heatmaply_cor(x, limits = c(-1, 1), colors = cool_warm, ...) point_size_name = "Point size", label_format_fun = function(...) format(..., digits = 4), custom_hovertext = x[["matrix"]][["custom_hovertext"]], + suppress_default_hovertext = FALSE, dend_hoverinfo = TRUE, side_color_colorbar_len = 0.3, plotly_source = "A", diff --git a/man/heatmapr.Rd b/man/heatmapr.Rd index 44bf89c..bf497a3 100644 --- a/man/heatmapr.Rd +++ b/man/heatmapr.Rd @@ -50,6 +50,7 @@ heatmapr( seriate = c("OLO", "mean", "none", "GW"), point_size_mat = NULL, custom_hovertext = NULL, + suppress_default_hovertext = FALSE, ... ) } @@ -172,6 +173,11 @@ Implemented options include: \item{custom_hovertext}{Custom hovertext matrix (the same dimensions as the input).} +\item{suppress_default_hovertext}{Logical (FALSE) indicating whether to hide the +default hovertext for plot_method = "ggplot" of row, column, value, and Point +size.} + + \item{...}{currently ignored} } \description{ From ab4c678278b45a5eb1056f4f73a4b238751e05dd Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Sun, 14 Jul 2024 21:09:37 -0700 Subject: [PATCH 13/14] Remove @param for suppress_default_hovertext in heatmapr.R --- R/heatmapr.R | 4 ---- 1 file changed, 4 deletions(-) diff --git a/R/heatmapr.R b/R/heatmapr.R index c30409f..86b9487 100644 --- a/R/heatmapr.R +++ b/R/heatmapr.R @@ -127,10 +127,6 @@ fix_not_all_unique <- function(x, ...) { #' @param point_size_mat A matrix of values which can be mapped to point size #' @param custom_hovertext Custom hovertext matrix (the same dimensions as the input). #' -#' @param suppress_default_hovertext Logical indicating whether to hide the -#' default hovertext for plot_method = "ggplot" of row, column, value, and Point -#' size. -#' #' @param ... currently ignored #' #' @export From 40f0e84008d55fd2b3f9f0624f7db0c46f3a9f5c Mon Sep 17 00:00:00 2001 From: "mcsimenc@gmail.com" Date: Tue, 16 Jul 2024 09:06:58 -0700 Subject: [PATCH 14/14] Ran roxygenise --- R/heatmaply.R | 2 +- man/heatmaply.Rd | 6 +++--- man/heatmapr.Rd | 6 ------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/R/heatmaply.R b/R/heatmaply.R index 159d289..4666997 100644 --- a/R/heatmaply.R +++ b/R/heatmaply.R @@ -814,8 +814,8 @@ heatmaply.default <- function(x, node_type = node_type, point_size_name = point_size_name, label_format_fun = label_format_fun, - dend_hoverinfo = dend_hoverinfo, suppress_default_hovertext = suppress_default_hovertext, + dend_hoverinfo = dend_hoverinfo, side_color_colorbar_len = side_color_colorbar_len, plotly_source = plotly_source, height = height, diff --git a/man/heatmaply.Rd b/man/heatmaply.Rd index 88c8c2e..bfa4c7d 100644 --- a/man/heatmaply.Rd +++ b/man/heatmaply.Rd @@ -476,7 +476,7 @@ backward compatibility with gplots::heatmap.2.} If plot_method is "plotly" then just this text is displayed; if plot_method if "ggplot" then it is appended to the existing text.} -\item{suppress_default_hovertext}{Logical (FALSE) indicating whether to hide the +\item{suppress_default_hovertext}{Logical indicating whether to hide the default hovertext for plot_method = "ggplot" of row, column, value, and Point size.} @@ -648,12 +648,12 @@ heatmaply(percentize(mtcars), # Example of removing labels and thus making the plot faster -heatmaply(iris, showticklabels = c(T, F), margins = c(80, 10)) +heatmaply(iris, showticklabels = c(TRUE, FALSE), margins = c(80, 10)) # this is what allows for a much larger matrix to be printed: set.seed(2017 - 05 - 18) large_x <- matrix(rnorm(19), 1000, 100) -heatmaply(large_x, dendrogram = F, showticklabels = F, margins = c(1, 1)) +heatmaply(large_x, dendrogram = FALSE, showticklabels = FALSE, margins = c(1, 1)) } \dontrun{ heatmaply_na(airquality) diff --git a/man/heatmapr.Rd b/man/heatmapr.Rd index bf497a3..44bf89c 100644 --- a/man/heatmapr.Rd +++ b/man/heatmapr.Rd @@ -50,7 +50,6 @@ heatmapr( seriate = c("OLO", "mean", "none", "GW"), point_size_mat = NULL, custom_hovertext = NULL, - suppress_default_hovertext = FALSE, ... ) } @@ -173,11 +172,6 @@ Implemented options include: \item{custom_hovertext}{Custom hovertext matrix (the same dimensions as the input).} -\item{suppress_default_hovertext}{Logical (FALSE) indicating whether to hide the -default hovertext for plot_method = "ggplot" of row, column, value, and Point -size.} - - \item{...}{currently ignored} } \description{