Browse code

update

Guangchuang Yu authored on 20/06/2022 07:13:19
Showing5 changed files

... ...
@@ -1,7 +1,7 @@
1 1
 Package: ggtree
2 2
 Type: Package
3 3
 Title: an R package for visualization of tree and annotation data
4
-Version: 3.5.0.901
4
+Version: 3.5.0.902
5 5
 Authors@R: c(
6 6
        person("Guangchuang", "Yu",     email = "guangchuangyu@gmail.com", role = c("aut", "cre", "cph"), 
7 7
             comment = c(ORCID = "0000-0002-6485-8781")),
... ...
@@ -25,8 +25,9 @@
25 25
 
26 26
 -->
27 27
 
28
-# ggtree 3.5.0.901
28
+# ggtree 3.5.0.902
29 29
 
30
++ add outline to nodepies (2022-06-20, Mon, #506)
30 31
 + `update_edge_hclust()` to adjust edge length of a `phylo` object converted from a `hclust` object via `ape::as.phylo()` (2022-06-05, Sun)
31 32
 + new 'slanted' layout for `branch.length = 'none'` (2022-04-29, Fri, #497)
32 33
     - only works for Cartesian coordination, that means it will not work for `layout = 'radial'`
... ...
@@ -116,6 +116,8 @@ nodebar <- function(data, cols, color, alpha=1, position="stack") {
116 116
 ##' @param cols columns of the data.frame that store the stats
117 117
 ##' @param color set color of bars
118 118
 ##' @param alpha set transparency of the charts
119
+##' @param outline.color color of outline
120
+##' @param outline.size size of outline
119 121
 ##' @return list of ggplot objects
120 122
 ##' @export
121 123
 ##' @author Guangchuang Yu
... ...
@@ -1352,7 +1352,7 @@ update_edge_hclust <- function(tr, h) {
1352 1352
   len <- numeric(max(tr$edge))
1353 1353
   len[nodes] <- h$height
1354 1354
   pn <- ev[nodes]
1355
-  pn[pn == 0] <- rootnode(tr)
1355
+  pn[pn == 0] <- treeio::rootnode(tr)
1356 1356
   len[nodes] <- len[pn] - len[nodes]
1357 1357
   len[1:Ntip(tr)] <- max(h$height)/10
1358 1358
 
... ...
@@ -4,7 +4,14 @@
4 4
 \alias{nodepie}
5 5
 \title{nodepie}
6 6
 \usage{
7
-nodepie(data, cols, color, alpha = 1)
7
+nodepie(
8
+  data,
9
+  cols,
10
+  color,
11
+  alpha = 1,
12
+  outline.color = "transparent",
13
+  outline.size = 0
14
+)
8 15
 }
9 16
 \arguments{
10 17
 \item{data}{a data.frame of stats with an additional column of node number named "node"}
... ...
@@ -14,6 +21,10 @@ nodepie(data, cols, color, alpha = 1)
14 21
 \item{color}{set color of bars}
15 22
 
16 23
 \item{alpha}{set transparency of the charts}
24
+
25
+\item{outline.color}{color of outline}
26
+
27
+\item{outline.size}{size of outline}
17 28
 }
18 29
 \value{
19 30
 list of ggplot objects