Skip to content

Commit db95519

Browse files
authored
collaborate is no longer a supported option for config and should not be included in the examples (#2486)
* Fixing docs for config() to avoid deprecated example * Adding unit test for deprecation warning * Rebuilding docs for collaborated deprecation change
1 parent f8765bd commit db95519

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

R/layout.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ rangeslider <- function(p, start = NULL, end = NULL, ...) {
105105
#' @export
106106
#' @examplesIf interactive() || !identical(.Platform$OS.type, "windows")
107107
#'
108-
#' # remove the plotly logo and collaborate button from modebar
109-
#' config(plot_ly(), displaylogo = FALSE, collaborate = FALSE)
108+
#' # remove the plotly logo and 2D lasso option from modebar
109+
#' config(plot_ly(), displaylogo = FALSE, modeBarButtonsToRemove = list("lasso2d"))
110110
#'
111111
#' # enable mathjax
112112
#' # see more examples at https://plotly.com/r/LaTeX/

man/config.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-plotly.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,12 @@ test_that("Informative deprecation message for titlefont", {
303303
expect_warning(config(plot_ly(), cloud = TRUE), "cloud")
304304
})
305305

306+
test_that("Informative deprecation message for collaborate", {
307+
p <- plot_ly(x = 1:3, mode = "markers", type = "scatter")
308+
expect_warning(config(p, collaborate=TRUE), regexp = "collaborate button")
309+
expect_warning(config(p, collaborate=FALSE), regexp = "collaborate button")
310+
})
311+
306312
test_that("Informative warning for invalid config attr", {
307313
p <- config(plot_ly(), foobar = TRUE)
308314
expect_warning(plotly_build(p), "foobar")

0 commit comments

Comments
 (0)