From 1b065edfa2073580856fe4d13516742604409c94 Mon Sep 17 00:00:00 2001 From: Russ Hyde Date: Tue, 6 Dec 2022 16:58:02 +0000 Subject: [PATCH] feat: treeview() outputs either .rds or .html (or both) for interactive plots --- R/treeview.R | 12 ++++++++---- man/treeview.Rd | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/R/treeview.R b/R/treeview.R index 96c1cc3..985dac0 100644 --- a/R/treeview.R +++ b/R/treeview.R @@ -12,13 +12,15 @@ #' @param output_dir Outputs will be saved in this directory. Will create the directory if it does #' not exist. #' @param output_format String (either \code{rds}, \code{html} or both). Default: both. In which -#' format(s) should the sina-cluster plots be saved? +#' format(s) should the interactive plots be saved? For \code{rds}, a \code{ggtree} or +#' \code{ggplot2} object will be placed in \code{rds} files. For \code{html}, \code{htmlwidget}s +#' will be placed in a \code{html} file. #' @param heatmap_width,heatmap_lab_offset Width and label-offset parameters for the constructed #' heatmap. #' #' @importFrom rlang .data #' -#' @return A ggtree plot +#' @return A \code{ggtree} plot. #' #' @export @@ -251,7 +253,8 @@ treeview <- function(e0, lgr_trees, branch_col = "logistic_growth_rate", n_leaves = n_leaves, - output_dir = output_dir + output_dir = output_dir, + output_format = output_format ) for (branch_col in setdiff(branch_cols, c("logistic_growth_rate"))) { @@ -263,7 +266,8 @@ treeview <- function(e0, tree_list, branch_col = branch_col, n_leaves = n_leaves, - output_dir = output_dir + output_dir = output_dir, + output_format = output_format ) } }) diff --git a/man/treeview.Rd b/man/treeview.Rd index 01f575e..7226756 100644 --- a/man/treeview.Rd +++ b/man/treeview.Rd @@ -30,13 +30,15 @@ logistic growth rate plot will always be produced.} not exist.} \item{output_format}{String (either \code{rds}, \code{html} or both). Default: both. In which -format(s) should the sina-cluster plots be saved?} +format(s) should the interactive plots be saved? For \code{rds}, a \code{ggtree} or +\code{ggplot2} object will be placed in \code{rds} files. For \code{html}, \code{htmlwidget}s +will be placed in a \code{html} file.} \item{heatmap_width, heatmap_lab_offset}{Width and label-offset parameters for the constructed heatmap.} } \value{ -A ggtree plot +A \code{ggtree} plot. } \description{ This will produce a set of html widgets which will highlight by colour and tooltips statistics