Skip to content

Commit

Permalink
copy rect_to_poly, #601
Browse files Browse the repository at this point in the history
  • Loading branch information
GuangchuangYu committed Feb 12, 2024
1 parent ee1a177 commit 465e08d
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 26 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ggtree
Type: Package
Title: an R package for visualization of tree and annotation data
Version: 3.11.0
Version: 3.11.0.001
Authors@R: c(
person("Guangchuang", "Yu", email = "[email protected]", role = c("aut", "cre", "cph"),
comment = c(ORCID = "0000-0002-6485-8781")),
Expand Down Expand Up @@ -63,5 +63,5 @@ BugReports: https://github.com/YuLab-SMU/ggtree/issues
Packaged: 2014-12-03 08:16:14 UTC; root
biocViews: Alignment, Annotation, Clustering, DataImport,
MultipleSequenceAlignment, Phylogenetics, ReproducibleResearch, Software, Visualization
RoxygenNote: 7.3.0
RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
- <https://github.com/thomasp85/ggraph/commit/14de66f1225336179b4598cb42a4beda95682211>
-->
# ggtree 3.11.0.001

+ copy `rect_to_poly()` from ggplot2 to make it compatible with the comming release of ggplot2 (2024-02-13, Tue)

# ggtree 3.10.0

Expand Down
23 changes: 21 additions & 2 deletions R/geom_hilight.R
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ build_align_data <- function(data, align){
}


#' @importFrom utils getFromNamespace
rect_to_poly <- getFromNamespace("rect_to_poly", "ggplot2")



## ##' layer of hilight clade with rectangle
## ##'
Expand Down Expand Up @@ -627,3 +627,22 @@ rect_to_poly <- getFromNamespace("rect_to_poly", "ggplot2")
## required_aes = c("x", "y") #, "branch.length")
## )

#' @importFrom utils getFromNamespace
data_frame0 <- getFromNamespace("data_frame0", "ggplot2")


# taken from ggplot2 as it was removed in recent release.
#
# Convert rectangle to polygon
# Useful for non-Cartesian coordinate systems where it's easy to work purely in
# terms of locations, rather than locations and dimensions. Note that, though
# `polygonGrob()` expects an open form, closed form is needed for correct
# munching (c.f. https://github.com/tidyverse/ggplot2/issues/3037#issuecomment-458406857).
#
# @keyword internal
rect_to_poly <- function(xmin, xmax, ymin, ymax) {
data_frame0(
y = c(ymax, ymax, ymin, ymin, ymax),
x = c(xmin, xmax, xmax, xmin, xmin)
)
}
14 changes: 2 additions & 12 deletions R/ggtree-package.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
##' visualizing phylogenetic tree and heterogenous associated data based on grammar of graphics
##' `ggtree` provides functions for visualizing phylogenetic tree and its associated data in R.
##'
##' If you use ggtree in published research, please cite:
##' Guangchuang Yu, David Smith, Huachen Zhu, Yi Guan, Tommy Tsan-Yuk Lam.
##' 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, doi:10.1111/2041-210X.12628
##'
##' @docType package
##' @name ggtree
##' @aliases ggtree package-ggtree
NULL
#' @keywords internal
"_PACKAGE"

40 changes: 40 additions & 0 deletions man/ggtree-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 2 additions & 10 deletions man/ggtree.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 465e08d

Please sign in to comment.