Skip to content

Commit d365372

Browse files
committed
drop ggplot2 2.2.1 support (i.e., require most recent CRAN release)
1 parent efe5535 commit d365372

File tree

7 files changed

+7
-567
lines changed

7 files changed

+7
-567
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CONDUCT.md
66
CONTRIBUTING.md
77
build_site.R
88
travis_debug.R
9+
revdep_email.R
910
todo.R
1011
.github/
1112
inst/examples/rmd/*.html
@@ -17,3 +18,4 @@ revdep/
1718
^LICENSE\.md$
1819
README.Rmd
1920
abbvie.R
21+
^\.httr-oauth$

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Rapp.history
66
*.DS_Store
77
node_modules/
88
build_site.R
9+
revdep_email.R
910
abbvie.R
1011
todo.R
1112
inst/examples/rmd/*.html
@@ -15,3 +16,4 @@ Untitled*
1516
rsconnect/
1617
revdep/
1718
travis_debug.R
19+
.httr-oauth

DESCRIPTION

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ URL: https://plot.ly/r, https://cpsievert.github.io/plotly_book/, https://github
2222
BugReports: https://github.com/ropensci/plotly/issues
2323
Depends:
2424
R (>= 3.2.0),
25-
ggplot2 (>= 2.2.1)
25+
ggplot2 (> 2.2.1)
2626
Imports:
2727
tools,
2828
scales,
@@ -68,8 +68,6 @@ Suggests:
6868
RSelenium,
6969
png,
7070
IRdisplay
71-
Remotes:
72-
tidyverse/ggplot2
7371
LazyData: true
7472
RoxygenNote: 6.0.1.9000
7573
Encoding: UTF-8

R/ggplotly-legacy.R

Lines changed: 0 additions & 534 deletions
This file was deleted.

R/ggplotly.R

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -211,26 +211,6 @@ gg2list <- function(p, width = NULL, height = NULL,
211211
)
212212
}
213213

214-
# we currently support ggplot2 >= 2.2.1 (see DESCRIPTION)
215-
# there are too many naming changes in 2.2.1.9000 to realistically
216-
if (!is_dev_ggplot2()) {
217-
message(
218-
"We recommend that you use the dev version of ggplot2 with `ggplotly()`\n",
219-
"Install it with: `devtools::install_github('tidyverse/ggplot2')`"
220-
)
221-
if (!identical(dynamicTicks, FALSE)) {
222-
warning(
223-
"You need the dev version of ggplot2 to use `dynamicTicks`", call. = FALSE
224-
)
225-
}
226-
return(
227-
gg2list_legacy(
228-
p, width = width, height = height, tooltip = tooltip,
229-
layerData = layerData, originalData = originalData, source = source, ...
230-
)
231-
)
232-
}
233-
234214
# ------------------------------------------------------------------------
235215
# Our internal version of ggplot2::ggplot_build(). Modified from
236216
# https://github.com/hadley/ggplot2/blob/0cd0ba/R/plot-build.r#L18-L92
@@ -265,8 +245,7 @@ gg2list <- function(p, width = NULL, height = NULL,
265245
# save the domain of the group for display in tooltips
266246
groupDomains <- Map(function(x, y) {
267247
aes_g <- y$mapping[["group"]] %||% plot$mapping[["group"]]
268-
eval_ <- if (is_dev_ggplot2()) rlang::eval_tidy else base::eval
269-
tryNULL(eval_(aes_g, x))
248+
tryNULL(rlang::eval_tidy(aes_g, x))
270249
}, data, layers)
271250

272251
# for simple (StatIdentity) geoms, add crosstalk key to aes mapping
@@ -1286,10 +1265,6 @@ rect2shape <- function(rekt = ggplot2::element_rect()) {
12861265
)
12871266
}
12881267

1289-
is_dev_ggplot2 <- function() {
1290-
packageVersion("ggplot2") > "2.2.1"
1291-
}
1292-
12931268
# We need access to internal ggplot2 functions in several places
12941269
# this helps us import functions in a way that R CMD check won't cry about
12951270
ggfun <- function(x) {

R/layers2traces.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ layers2traces <- function(data, prestats_data, layout, p) {
8282
# 2. geom_smooth() is really geom_path() + geom_ribbon()
8383
datz <- list()
8484
paramz <- list()
85-
layout <- if (is_dev_ggplot2()) layout else list(layout = layout)
8685
for (i in seq_along(data)) {
8786
# This has to be done in a loop, since some layers are really two layers,
8887
# (and we need to replicate the data/params in those cases)

tests/testthat.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@ test_run <- function(...) {
150150
test_check(...)
151151
}
152152

153-
if (packageVersion("ggplot2") > "2.2.1") {
154-
test_run("plotly")
155-
}
153+
test_run("plotly")
156154

157155
# now, actually build the table (if necessary)
158156
if (build_table) {

0 commit comments

Comments
 (0)