Skip to content

Commit c036488

Browse files
committed
Merge remote-tracking branch 'upstream/master' into sec_scale
2 parents b7ac60c + 828e948 commit c036488

File tree

123 files changed

+556
-426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+556
-426
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ Collate:
164164
'layout.R'
165165
'limits.r'
166166
'margins.R'
167+
'performance.R'
167168
'plot-build.r'
168169
'plot-construction.r'
169170
'plot-last.r'
@@ -243,6 +244,6 @@ Collate:
243244
'zxx.r'
244245
'zzz.r'
245246
VignetteBuilder: knitr
246-
RoxygenNote: 6.1.0
247+
RoxygenNote: 6.1.1
247248
Roxygen: list(markdown = TRUE)
248249
Encoding: UTF-8

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export(GeomText)
180180
export(GeomTile)
181181
export(GeomViolin)
182182
export(GeomVline)
183+
export(LayerSf)
183184
export(Layout)
184185
export(Position)
185186
export(PositionDodge)

NEWS.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
# ggplot2 3.1.0.9000
22

3-
* `geom_rug()` now works with `coord_flip()` (@has2k1, #2987).
3+
* `geom_rug()` now works with `coord_flip()` (@has2k1, #2987).
4+
5+
* Layers now have a new member function `setup_layer()` which is called at the
6+
very beginning of the plot building process and which has access to the original
7+
input data and the plot object being built. This function allows the creation of
8+
custom layers that autogenerate aesthetic mappings based on the input data or that
9+
filter the input data in some form. One example is the new `LayerSf` class which
10+
locates the geometry column in sf objects and sets up an aesthetic mapping for it
11+
(@clauswilke, #2872).
412

513
* Default labels are now generated more consistently; e.g., symbols no longer
614
get backticks, and long expressions are abbreviated with `...`
715
(@yutannihilation, #2981).
816

917
* Aesthetic mappings now accept functions that return `NULL` (@yutannihilation,
10-
#2997)
18+
#2997).
1119

1220
* Closed arrows in `element_line()` are now filled (@yutannihilation, #2924).
1321

R/annotation-custom.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ GeomCustomAnn <- ggproto("GeomCustomAnn", Geom,
7474
stop("annotation_custom only works with Cartesian coordinates",
7575
call. = FALSE)
7676
}
77-
corners <- data.frame(x = c(xmin, xmax), y = c(ymin, ymax))
77+
corners <- new_data_frame(list(x = c(xmin, xmax), y = c(ymin, ymax)), n = 2)
7878
data <- coord$transform(corners, panel_params)
7979

8080
x_rng <- range(data$x, na.rm = TRUE)

R/annotation-logticks.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ calc_logticks <- function(base = 10, ticks_per_base = base - 1,
238238
longtick_after_base <- floor(ticks_per_base/2)
239239
tickend[ cycleIdx == longtick_after_base ] <- midend
240240

241-
tickdf <- data.frame(value = ticks, start = start, end = tickend)
241+
tickdf <- new_data_frame(list(value = ticks, start = start, end = tickend), n = length(ticks))
242242

243243
return(tickdf)
244244
}

R/annotation-raster.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ GeomRasterAnn <- ggproto("GeomRasterAnn", Geom,
7676
stop("annotation_raster only works with Cartesian coordinates",
7777
call. = FALSE)
7878
}
79-
corners <- data.frame(x = c(xmin, xmax), y = c(ymin, ymax))
79+
corners <- new_data_frame(list(x = c(xmin, xmax), y = c(ymin, ymax)), n = 2)
8080
data <- coord$transform(corners, panel_params)
8181

8282
x_rng <- range(data$x, na.rm = TRUE)

R/annotation.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ annotate <- function(geom, x = NULL, y = NULL, xmin = NULL, xmax = NULL,
5454
stop("Unequal parameter lengths: ", details, call. = FALSE)
5555
}
5656

57-
data <- data.frame(position)
57+
data <- new_data_frame(position, n = max(lengths))
5858
layer(
5959
geom = geom,
6060
params = list(

R/axis-secondary.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ AxisSecondary <- ggproto("AxisSecondary", NULL,
140140
},
141141

142142
transform_range = function(self, range) {
143-
range <- structure(data.frame(range), names = '.')
143+
range <- new_data_frame(list(. = range))
144144
rlang::eval_tidy(
145145
rlang::f_rhs(self$trans),
146146
data = range,

R/bench.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ benchplot <- function(x) {
2323

2424
times <- rbind(construct, build, render, draw)[, 1:3]
2525

26-
plyr::unrowname(data.frame(
26+
plyr::unrowname(base::data.frame(
2727
step = c("construct", "build", "render", "draw", "TOTAL"),
2828
rbind(times, colSums(times))))
2929
}

R/bin.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,14 @@ bin_out <- function(count = integer(0), x = numeric(0), width = numeric(0),
157157
xmin = x - width / 2, xmax = x + width / 2) {
158158
density <- count / width / sum(abs(count))
159159

160-
data.frame(
160+
new_data_frame(list(
161161
count = count,
162162
x = x,
163163
xmin = xmin,
164164
xmax = xmax,
165165
width = width,
166166
density = density,
167167
ncount = count / max(abs(count)),
168-
ndensity = density / max(abs(density)),
169-
stringsAsFactors = FALSE
170-
)
168+
ndensity = density / max(abs(density))
169+
), n = length(count))
171170
}

0 commit comments

Comments
 (0)