Skip to content

Commit 55ad5dd

Browse files
author
Kirill Müller
committed
Merge branch 'master' into vjust
2 parents b17a294 + 02fdb3e commit 55ad5dd

File tree

7 files changed

+49
-18
lines changed

7 files changed

+49
-18
lines changed

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,26 @@ install:
1313

1414
script: ./travis-tool.sh run_tests
1515

16+
after_success:
17+
- ./travis-tool.sh install_github hadley/staticdocs
18+
- R -e "staticdocs::build_site()"
19+
1620
on_failure:
1721
- ./travis-tool.sh dump_logs
1822

1923
notifications:
2024
email:
2125
on_success: change
2226
on_failure: change
27+
28+
deploy:
29+
edge: true
30+
31+
provider: s3
32+
access_key_id: AKIAJDM6KGIZ6LSGAK4Q
33+
secret_access_key:
34+
secure: "r3vSpvVNcpvIcjWFyk+GhYG55iuhfmy3mwuQHQS2EqjT3Skd3mOojnZuRIqy60XXElK5/nfa3qt7KH0GCSd4Is28cqPwh+1PtQ0ZVXfeKefAk2whTPDI4P+rgOA+srUxZraLALap9QGmvlzJyXbqBCRdDmXUjtXKi2ONE9PrUk4="
35+
bucket: docs.ggplot2.org
36+
skip_cleanup: true
37+
local-dir: inst/web
38+
upload-dir: dev

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ ggplot2 0.9.3.1.99
99

1010
* Fix vertical justification for rotated text. (@krlmlr, #883)
1111

12+
* `aes()` no more treats variables like `a..x..b as a calculated aesthetic.
13+
(@krlmlr, #834.)
14+
15+
* Add `"none"` to documentation of `theme()` for parameter `legend.position`.
16+
(@krlmlr, #829)
17+
1218

1319
ggplot2 0.9.3.1
1420
----------------------------------------------------------------

R/labels.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ ggtitle <- function(label) {
6565
# Convert aesthetic mapping into text labels
6666
make_labels <- function(mapping) {
6767
remove_dots <- function(x) {
68-
gsub("\\.\\.([a-zA-z._]+)\\.\\.", "\\1", x)
68+
gsub(.calculated_aes_regex, "\\1", x)
6969
}
7070

7171
lapply(mapping, function(x) remove_dots(deparse(x)))

R/layer.r

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,19 @@ Layer <- proto(expr = {
258258
#' @export
259259
layer <- Layer$new
260260

261+
# Regex to determine if an identifier refers to a calculated aesthetic
262+
.calculated_aes_regex <- "^\\.\\.([a-zA-z._]+)\\.\\.$"
263+
261264
# Determine if aesthetic is calculated
262265
is_calculated_aes <- function(aesthetics) {
263-
match <- "\\.\\.([a-zA-z._]+)\\.\\."
264266
stats <- rep(FALSE, length(aesthetics))
265-
grepl(match, sapply(aesthetics, deparse))
267+
grepl(.calculated_aes_regex, sapply(aesthetics, deparse))
266268
}
267269

268270
# Strip dots from expressions
269271
strip_dots <- function(aesthetics) {
270-
match <- "\\.\\.([a-zA-z._]+)\\.\\."
271272
strings <- lapply(aesthetics, deparse)
272-
strings <- lapply(strings, gsub, pattern = match, replacement = "\\1")
273+
strings <- lapply(strings, gsub, pattern = .calculated_aes_regex,
274+
replacement = "\\1")
273275
lapply(strings, function(x) parse(text = x)[[1]])
274276
}

R/theme.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ print.theme <- function(x, ...) str(x)
114114
#' (\code{element_text}; inherits from \code{title}) \cr
115115
#' legend.title.align \tab alignment of legend title
116116
#' (number from 0 (left) to 1 (right)) \cr
117-
#' legend.position \tab the position of legends.
118-
#' ("left", "right", "bottom", "top", or two-element
117+
#' legend.position \tab the position of legends
118+
#' ("none", "left", "right", "bottom", "top", or two-element
119119
#' numeric vector) \cr
120120
#' legend.direction \tab layout of items in legends
121121
#' ("horizontal" or "vertical") \cr

inst/tests/test-layer.r

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
context("Layer")
2+
3+
test_that("Correctly decide if a variable is a calculated aesthetic", {
4+
expect_true(is_calculated_aes(aes(x=..density..)))
5+
expect_false(is_calculated_aes(aes(x=a..x..b)))
6+
expect_equal(as.character(strip_dots(aes(x=..density..))), "density")
7+
})

man/theme.Rd

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,17 @@ last example below.
8181
legend.title \tab title of legend (\code{element_text};
8282
inherits from \code{title}) \cr legend.title.align \tab
8383
alignment of legend title (number from 0 (left) to 1
84-
(right)) \cr legend.position \tab the position of
85-
legends. ("left", "right", "bottom", "top", or
86-
two-element numeric vector) \cr legend.direction \tab
87-
layout of items in legends ("horizontal" or "vertical")
88-
\cr legend.justification \tab anchor point for
89-
positioning legend inside plot ("center" or two-element
90-
numeric vector) \cr legend.box \tab arrangement of
91-
multiple legends ("horizontal" or "vertical") \cr
92-
legend.box.just \tab justification of each legend within
93-
the overall bounding box, when there are multiple legends
94-
("top", "bottom", "left", or "right")\cr
84+
(right)) \cr legend.position \tab the position of legends
85+
("none", "left", "right", "bottom", "top", or two-element
86+
numeric vector) \cr legend.direction \tab layout of items
87+
in legends ("horizontal" or "vertical") \cr
88+
legend.justification \tab anchor point for positioning
89+
legend inside plot ("center" or two-element numeric
90+
vector) \cr legend.box \tab arrangement of multiple
91+
legends ("horizontal" or "vertical") \cr legend.box.just
92+
\tab justification of each legend within the overall
93+
bounding box, when there are multiple legends ("top",
94+
"bottom", "left", or "right")\cr
9595

9696
panel.background \tab background of plotting area, drawn
9797
underneath plot (\code{element_rect}; inherits from

0 commit comments

Comments
 (0)