Skip to content

Commit fea72b6

Browse files
committed
maintain backwards-compatibility for cloud
1 parent 95cc431 commit fea72b6

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030

3131
## CHANGES
3232

33-
* The 'collaborate' button no longer appears in the modebar, and as a result, the `config()` function no longer has a `collaborate` argument.
34-
* Since plotly.js now defaults to *not* showing the "Edit in Chart Studio" button, the `cloud` argument in `config()` was removed. If you want to show this button, use the new plotly.js `showSendToCloud` config attribute instead (e.g. `config(plot_ly(), showSendToCloud = TRUE)`)
33+
* The 'collaborate' button no longer appears in the modebar, and is longer supported, so the `config()` function no longer has a `collaborate` argument.
34+
* The `cloud` argument is now deprecated and will be removed in a future version. Use `showSendToCloud` instead.
3535
* `ggplotly()` now translates title information to `layout.title.text` (instead of `layout.title`) and `layout.title.font` (instead of `layout.titlefont`)
3636

3737
## BUG FIXES

R/layout.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ rangeslider <- function(p, start = NULL, end = NULL, ...) {
8888
#' @param p a plotly object
8989
#' @param ... these arguments are documented at
9090
#' \url{https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js}
91+
#' @param cloud deprecated. Use `showSendToCloud` instead.
92+
#' @param showSendToCloud include the send data to cloud button?
9193
#' @param locale locale to use. See [here](https://github.com/plotly/plotly.js/tree/master/dist#to-include-localization) for more info.
9294
#' @param mathjax add [MathJax rendering support](https://github.com/plotly/plotly.js/tree/master/dist#to-support-mathjax).
9395
#' If `"cdn"`, mathjax is loaded externally (meaning an internet connection is needed for
@@ -129,7 +131,7 @@ rangeslider <- function(p, start = NULL, end = NULL, ...) {
129131
#' config(p, locale = "zh-CN")
130132
#'
131133

132-
config <- function(p, ..., locale = NULL, mathjax = NULL) {
134+
config <- function(p, ..., cloud = FALSE, showSendToCloud = cloud, locale = NULL, mathjax = NULL) {
133135

134136
if (!is.null(locale)) {
135137
p$dependencies <- c(
@@ -157,6 +159,8 @@ config <- function(p, ..., locale = NULL, mathjax = NULL) {
157159
args <- list(...)
158160
if ("collaborate" %in% names(args)) warning("The collaborate button is no longer supported")
159161
p$x$config <- modify_list(p$x$config, args)
162+
if (cloud) message("The `cloud` argument is deprecated. Use `showSendToCloud` instead.")
163+
p$x$config$showSendToCloud <- showSendToCloud
160164

161165
p
162166
}

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ verify_attr <- function(proposed, schema) {
524524
attrs_name_check <- function(proposedAttrs, validAttrs, type = "scatter") {
525525
illegalAttrs <- setdiff(proposedAttrs, validAttrs)
526526
if ("titlefont" %in% illegalAttrs) {
527-
warning("The titlefont attribute is now deprecated. Use title = list(font = ...) instead.", call. = FALSE)
527+
warning("The titlefont attribute is deprecated. Use title = list(font = ...) instead.", call. = FALSE)
528528
illegalAttrs <- setdiff(illegalAttrs, "titlefont")
529529
}
530530
if (length(illegalAttrs)) {

man/config.Rd

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

0 commit comments

Comments
 (0)