Skip to content

Commit

Permalink
feat: mouseover just displays 'Cluster ID: NNNN'
Browse files Browse the repository at this point in the history
  • Loading branch information
russHyde committed Jan 20, 2023
1 parent dc614b3 commit 3961cc4
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions R/plot_tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,21 +232,9 @@ create_noninteractive_ggtree <- function(ggtree_data,
append_interactivity_data <- function(ggobj,
branch_col) {
# make mouseover info
## standard meta data
ttdfs <- apply(ggobj$data, 1, FUN = function(x) {
z <- as.list(x)
y <- data.frame(
`Cluster ID` = z[["cluster_id"]]
)
y <- t(y)
colnames(y) <- ""
tryCatch(
paste(knitr::kable(y, "simple"), collapse = "\n"),
error = function(e) paste(knitr::kable(y, "markdown"), collapse = "\n")
)
})

ggobj$data$mouseover <- ttdfs
ggobj$data$mouseover <- glue::glue(
"Cluster ID: {ggobj$data$cluster_id}"
)
ggobj$data$colour_var <- ggobj$data[[branch_col]]

ggobj
Expand Down

0 comments on commit 3961cc4

Please sign in to comment.