Skip to content

Commit 690e985

Browse files
committed
Better warning. s/secret/hidden/g
1 parent aa33ec8 commit 690e985

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

R/plotly_POST.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#' Plotly to view this graph. You can privately share this graph with other
2020
#' Plotly users in your online Plotly account and they will need to be logged
2121
#' in to view this plot.
22-
#' If 'secret', anyone with this secret link can view this chart. It will
22+
#' If 'hidden', anyone with this hidden link can view this chart. It will
2323
#' not appear in the Plotly feed, your profile, or search engines.
2424
#' If it is embedded inside a webpage or an IPython notebook, anybody who is
2525
#' viewing that page will be able to view the graph.
@@ -36,7 +36,7 @@
3636
#' }
3737

3838
plotly_POST <- function(x, filename, fileopt = "new",
39-
sharing = c("public", "private", "secret")) {
39+
sharing = c("public", "private", "hidden")) {
4040
x <- plotly_build(x)
4141
x$filename <- if (!missing(filename)) {
4242
filename
@@ -52,8 +52,10 @@ plotly_POST <- function(x, filename, fileopt = "new",
5252
}
5353
x$fileopt <- fileopt
5454
if (!is.null(x$world_readable)) {
55-
warning("world_readable was specified in the wrong place.",
56-
"Please use the sharing argument in plotly_POST()")
55+
warning('world_readable is no longer supported. Instead, set the sharing\n',
56+
'argument to "private" (you must be logged in to access),\n',
57+
'"hidden" (anybody with the obscured URL can access) or "public"\n',
58+
'(anybody can view).')
5759
}
5860
x$world_readable <- if (sharing[1] == "public") TRUE else FALSE
5961

@@ -72,7 +74,7 @@ plotly_POST <- function(x, filename, fileopt = "new",
7274
base_url <- file.path(get_domain(), "clientresp")
7375
resp <- httr::POST(base_url, body = bod)
7476
con <- process(struct(resp, "clientresp"))
75-
if (sharing[1] == "secret") {
77+
if (sharing[1] == "hidden") {
7678
bits <- strsplit(con$url, "/")[[1]]
7779
plot_id <- bits[length(bits)]
7880
url <- paste0(get_domain("v2"), "files/", verify("username"), ":", plot_id)

0 commit comments

Comments
 (0)