Skip to content
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
9 changes: 7 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# ggplot2 3.0.0.9000

* `geom_hex()` now understands the `size` and `linetype` aesthetics
(@mikmart, #2488).
* `geom_hex()` now understands the `size` and `linetype` aesthetics
(@mikmart, #2488).

* Data is no longer internally reordered when faceting. This makes it safer to
feed data columns into `aes()` or into parameters of geoms or stats. However,
doing so remains discouraged (@clauswilke).


# ggplot2 3.0.0

## Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion R/facet-grid-.r
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ FacetGrid <- ggproto("FacetGrid", Facet,

data$PANEL <- layout$PANEL[match(keys$x, keys$y)]
}
data[order(data$PANEL), , drop = FALSE]
data
},
draw_panels = function(panels, layout, x_scales, y_scales, ranges, coord, data, theme, params) {
if ((params$free$x || params$free$y) && !coord$is_free()) {
Expand Down
2 changes: 1 addition & 1 deletion R/facet-wrap.r
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ FacetWrap <- ggproto("FacetWrap", Facet,
keys <- plyr::join.keys(facet_vals, layout, by = names(vars))

data$PANEL <- layout$PANEL[match(keys$x, keys$y)]
data[order(data$PANEL), ]
data
},
draw_panels = function(panels, layout, x_scales, y_scales, ranges, coord, data, theme, params) {
if ((params$free$x || params$free$y) && !coord$is_free()) {
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-facet-map.r
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test_that("grid: missing facet columns are duplicated", {

loc_a <- panel_map_one(facet, df_a, plot_data = df)
expect_equal(nrow(loc_a), 4)
expect_equal(loc_a$PANEL, factor(1:4))
expect_equal(loc_a$PANEL, factor(c(1, 3, 2, 4)))

loc_b <- panel_map_one(facet, df_b, plot_data = df)
expect_equal(nrow(loc_b), 4)
Expand All @@ -47,8 +47,8 @@ test_that("wrap: missing facet columns are duplicated", {

loc_a <- panel_map_one(facet, df_a, plot_data = df)
expect_equal(nrow(loc_a), 4)
expect_equal(loc_a$PANEL, factor(1:4))
expect_equal(loc_a$a, c(1, 1, 2, 2))
expect_equal(loc_a$PANEL, factor(c(1, 3, 2, 4)))
expect_equal(loc_a$a, c(1, 2, 1, 2))

loc_b <- panel_map_one(facet, df_b, plot_data = df)
expect_equal(nrow(loc_b), 4)
Expand Down