... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
Package: ggtree |
2 | 2 |
Type: Package |
3 | 3 |
Title: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data |
4 |
-Version: 1.7.9 |
|
4 |
+Version: 1.7.10 |
|
5 | 5 |
Authors@R: c( |
6 | 6 |
person("Guangchuang", "Yu", email = "guangchuangyu@gmail.com", role = c("aut", "cre", "cph")), |
7 | 7 |
person("Tommy Tsan-Yuk", "Lam", email = "tylam.tommy@gmail.com", rol = c("aut", "ths")), |
... | ... |
@@ -1,3 +1,7 @@ |
1 |
+CHANGES IN VERSION 1.7.10 |
|
2 |
+------------------------ |
|
3 |
+ o update subview to support mainview produced by `ggplot() + layers` <2017-03-13, Mon> |
|
4 |
+ |
|
1 | 5 |
CHANGES IN VERSION 1.7.9 |
2 | 6 |
------------------------ |
3 | 7 |
o fixed geom_range to support height_0.95_HPD <2017-03-03, Fri> |
... | ... |
@@ -1,6 +1,6 @@ |
1 | 1 |
##' add subview to mainview for ggplot2 objects |
2 | 2 |
##' |
3 |
-##' |
|
3 |
+##' |
|
4 | 4 |
##' @title subview |
5 | 5 |
##' @param mainview main view |
6 | 6 |
##' @param subview a ggplot or grob object |
... | ... |
@@ -11,15 +11,22 @@ |
11 | 11 |
##' @return ggplot object |
12 | 12 |
##' @importFrom ggplot2 annotation_custom |
13 | 13 |
##' @importFrom ggplot2 ggplotGrob |
14 |
+##' @importFrom ggplot2 ggplot_build |
|
14 | 15 |
##' @export |
15 | 16 |
##' @author Guangchuang Yu |
16 | 17 |
subview <- function(mainview, subview, x, y, width=.1, height=.1) { |
17 | 18 |
mapping <- mainview$mapping %>% as.character |
18 | 19 |
aes_x <- mapping["x"] |
19 | 20 |
aes_y <- mapping["y"] |
20 |
- |
|
21 |
- xrng <- mainview$data[, aes_x] %>% range |
|
22 |
- yrng <- mainview$data[, aes_y] %>% range |
|
21 |
+ |
|
22 |
+ if (is.na(aes_x) || is.na(aes_y)) { |
|
23 |
+ obj <- ggplot_build(mainview) |
|
24 |
+ xrng <- obj$layout$panel_ranges[[1]]$x.range |
|
25 |
+ yrng <- obj$layout$panel_ranges[[1]]$y.range |
|
26 |
+ } else { |
|
27 |
+ xrng <- mainview$data[, aes_x] %>% range |
|
28 |
+ yrng <- mainview$data[, aes_y] %>% range |
|
29 |
+ } |
|
23 | 30 |
|
24 | 31 |
for (i in seq_along(mainview$layers)) { |
25 | 32 |
layer <- mainview$layers[[i]] |
... | ... |
@@ -58,11 +65,11 @@ subview <- function(mainview, subview, x, y, width=.1, height=.1) { |
58 | 65 |
|
59 | 66 |
xrng <- diff(xrng) |
60 | 67 |
yrng <- diff(yrng) |
61 |
- |
|
68 |
+ |
|
62 | 69 |
if (!any(class(subview) %in% c("ggplot", "grob", "character"))) { |
63 | 70 |
stop("subview should be a ggplot or grob object, or an image file...") |
64 | 71 |
} |
65 |
- |
|
72 |
+ |
|
66 | 73 |
if (is(subview, "ggplot")) { |
67 | 74 |
sv <- ggplotGrob(subview) |
68 | 75 |
} else if (is(subview, "grob")) { |
... | ... |
@@ -76,7 +83,7 @@ subview <- function(mainview, subview, x, y, width=.1, height=.1) { |
76 | 83 |
|
77 | 84 |
width <- width/2 |
78 | 85 |
height <- height/2 |
79 |
- |
|
86 |
+ |
|
80 | 87 |
mainview + annotation_custom( |
81 | 88 |
sv, |
82 | 89 |
xmin = x - width*xrng, |
... | ... |
@@ -19,7 +19,7 @@ library("ypages") |
19 | 19 |
|
20 | 20 |
|
21 | 21 |
`r badge_bioc_release("ggtree", "green")` |
22 |
-`r badge_devel("ggtree", "green")` |
|
22 |
+`r badge_devel("guangchuangyu/ggtree", "green")` |
|
23 | 23 |
[](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#since) |
24 | 24 |
`r badge_bioc_download("ggtree", "total", "blue")` |
25 | 25 |
`r badge_bioc_download("ggtree", "month", "blue")` |
... | ... |
@@ -4,9 +4,9 @@ ggtree: an R package for visualization and annotation of phylogenetic trees with |
4 | 4 |
|
5 | 5 |
<img src="https://raw.githubusercontent.com/jotsetung/BioC-stickers/master/ggtree/ggtree.png" height="128", align="right" /> |
6 | 6 |
|
7 |
-[](https://bioconductor.org/packages/ggtree) [](https://github.com/ggtree) [](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#since) [](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) |
|
7 |
+[](https://bioconductor.org/packages/ggtree) [](https://github.com/guangchuangyu/ggtree) [](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#since) [](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) |
|
8 | 8 |
|
9 |
-[](http://www.repostatus.org/#active) [](https://codecov.io/gh/GuangchuangYu/ggtree) [](https://github.com/GuangchuangYu/ggtree/commits/master) [](https://github.com/GuangchuangYu/ggtree/network) [](https://github.com/GuangchuangYu/ggtree/stargazers) [](https://awesome-r.com/#awesome-r-graphic-displays) |
|
9 |
+[](http://www.repostatus.org/#active) [](https://codecov.io/gh/GuangchuangYu/ggtree) [](https://github.com/GuangchuangYu/ggtree/commits/master) [](https://github.com/GuangchuangYu/ggtree/network) [](https://github.com/GuangchuangYu/ggtree/stargazers) [](https://awesome-r.com/#awesome-r-graphic-displays) |
|
10 | 10 |
|
11 | 11 |
[](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#archives) [](https://bioconductor.org/checkResults/devel/bioc-LATEST/ggtree/) [](https://travis-ci.org/GuangchuangYu/ggtree) [](https://ci.appveyor.com/project/GuangchuangYu/ggtree) [](http://bioconda.github.io/recipes/bioconductor-ggtree/README.html) |
12 | 12 |
|
... | ... |
@@ -20,7 +20,7 @@ Please cite the following article when using `ggtree`: |
20 | 20 |
|
21 | 21 |
**G Yu**, DK Smith, H Zhu, Y Guan, TTY Lam<sup>\*</sup>. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. ***Methods in Ecology and Evolution***. 2017, 8(1):28-36. |
22 | 22 |
|
23 |
-[](http://dx.doi.org/10.1111/2041-210X.12628) [](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=7268358477862164627) [](https://www.altmetric.com/details/10533079) |
|
23 |
+[](http://dx.doi.org/10.1111/2041-210X.12628) [](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=7268358477862164627) [](https://www.altmetric.com/details/10533079) |
|
24 | 24 |
|
25 | 25 |
------------------------------------------------------------------------ |
26 | 26 |
|
... | ... |
@@ -33,32 +33,32 @@ For details, please visit our project website, <https://guangchuangyu.github.io/ |
33 | 33 |
|
34 | 34 |
### Citation |
35 | 35 |
|
36 |
-[](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=7268358477862164627) |
|
36 |
+[](https://scholar.google.com.hk/scholar?oi=bibs&hl=en&cites=7268358477862164627) |
|
37 | 37 |
|
38 | 38 |
+--+---------+---------+---------+---------+---------+---+ |
39 |
- 7 + * + |
|
39 |
+ 8 + * + |
|
40 |
+ | | |
|
40 | 41 |
| | |
41 | 42 |
6 + + |
42 | 43 |
| | |
43 |
- 5 + + |
|
44 | 44 |
| | |
45 | 45 |
4 + + |
46 |
- 3 + + |
|
47 | 46 |
| | |
48 |
- 2 + + |
|
49 | 47 |
| | |
50 |
- 1 + * + |
|
48 |
+ | | |
|
49 |
+ 2 + + |
|
50 |
+ | * | |
|
51 | 51 |
+--+---------+---------+---------+---------+---------+---+ |
52 | 52 |
2016 2016.2 2016.4 2016.6 2016.8 2017 |
53 | 53 |
|
54 | 54 |
### Download stats |
55 | 55 |
|
56 |
-[](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) |
|
56 |
+[](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) |
|
57 | 57 |
|
58 | 58 |
++-------------------+-------------------+--------------------+-------------------+-----------+ |
59 | 59 |
| * | |
60 |
- | * | |
|
61 |
- | * | |
|
60 |
+ | * * | |
|
61 |
+ | | |
|
62 | 62 |
| * * | |
63 | 63 |
| | |
64 | 64 |
1500 + + |