Skip to content

Minor fixes to keep compatibility with ggtern #2913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions R/ggplot-global.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,22 @@ ggplot_global$theme_current <- list()
ggplot_global$element_tree <- list()

# List of all aesthetics known to ggplot
ggplot_global$all_aesthetics <- c(
# (In the future, .all_aesthetics should be removed in favor
# of direct assignment to ggplot_global$all_aesthetics, see below.)
.all_aesthetics <- c(
"adj", "alpha", "angle", "bg", "cex", "col", "color",
"colour", "fg", "fill", "group", "hjust", "label", "linetype", "lower",
"lty", "lwd", "max", "middle", "min", "pch", "radius", "sample", "shape",
"size", "srt", "upper", "vjust", "weight", "width", "x", "xend", "xmax",
"xmin", "xintercept", "y", "yend", "ymax", "ymin", "yintercept", "z"
)

ggplot_global$all_aesthetics <- .all_aesthetics

# Aesthetic aliases
ggplot_global$base_to_ggplot <- c(
# (In the future, .base_to_ggplot should be removed in favor
# of direct assignment to ggplot_global$base_to_ggplot, see below.)
.base_to_ggplot <- c(
"col" = "colour",
"color" = "colour",
"pch" = "shape",
Expand All @@ -36,3 +42,5 @@ ggplot_global$base_to_ggplot <- c(
"min" = "ymin",
"max" = "ymax"
)

ggplot_global$base_to_ggplot <- .base_to_ggplot
2 changes: 1 addition & 1 deletion R/sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ default_aesthetics <- function(type) {
}
}

sf_grob <- function(row, lineend, linejoin, linemitre) {
sf_grob <- function(row, lineend = "butt", linejoin = "round", linemitre = 10) {
# Need to extract geometry out of corresponding list column
geometry <- row$geometry[[1]]

Expand Down
6 changes: 4 additions & 2 deletions R/theme-elements.r
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ el_def <- function(class = NULL, inherit = NULL, description = NULL) {


# This data structure represents the theme elements and the inheritance
# among them.
ggplot_global$element_tree <- list(
# among them. (In the future, .element_tree should be removed in favor
# of direct assignment to ggplot_global$element_tree, see below.)
.element_tree <- list(
line = el_def("element_line"),
rect = el_def("element_rect"),
text = el_def("element_text"),
Expand Down Expand Up @@ -352,6 +353,7 @@ ggplot_global$element_tree <- list(
aspect.ratio = el_def("character")
)

ggplot_global$element_tree <- .element_tree

# Check that an element object has the proper class
#
Expand Down