Skip to content

Commit bde1158

Browse files
committed
Merge pull request #484 from ropensci/fix/defaults
Fix/defaults
2 parents 7aa76fe + 7bb8bc3 commit bde1158

File tree

7 files changed

+25
-19
lines changed

7 files changed

+25
-19
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: plotly
22
Title: Create Interactive Web Graphics via Plotly's JavaScript Graphing Library
3-
Version: 3.0.0
3+
Version: 3.1.0
44
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
55
email = "cpsievert1@gmail.com"),
66
person("Chris", "Parmer", role = c("aut", "cph"),

NEWS

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
3.0.0
1+
3.1.0 -- 8 Mar 2015
2+
3+
CHANGES:
4+
5+
* The "hidden" sharing option in plotly_POST() was renamed to "secret".
6+
* The default value in the scale argument in plotly_IMAGE() is now 1.
7+
8+
3.0.0 -- 8 Mar 2015
29

310
NEW FEATURES:
411

R/layers2traces.R

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ to_basic.GeomDensity2d <- function(data, prestats_data, layout, params, ...) {
261261
to_basic.GeomAbline <- function(data, prestats_data, layout, params, ...) {
262262
data <- unique(data[c("PANEL", "intercept", "slope", "group")])
263263
data$group <- seq_len(nrow(data))
264-
lay <- tidyr::gather(layout, variable, x, x_min:x_max)
264+
lay <- tidyr::gather_(layout, "variable", "x", c("x_min", "x_max"))
265265
data <- merge(lay[c("PANEL", "x")], data, by = "PANEL")
266266
data$y <- with(data, intercept + slope * x)
267267
prefix_class(data, "GeomPath")
@@ -271,7 +271,7 @@ to_basic.GeomAbline <- function(data, prestats_data, layout, params, ...) {
271271
to_basic.GeomHline <- function(data, prestats_data, layout, params, ...) {
272272
data <- unique(data[c("PANEL", "yintercept", "group")])
273273
data$group <- seq_len(nrow(data))
274-
lay <- tidyr::gather(layout, variable, x, x_min:x_max)
274+
lay <- tidyr::gather_(layout, "variable", "x", c("x_min", "x_max"))
275275
data <- merge(lay[c("PANEL", "x")], data, by = "PANEL")
276276
data$y <- data$yintercept
277277
prefix_class(data, "GeomPath")
@@ -281,7 +281,7 @@ to_basic.GeomHline <- function(data, prestats_data, layout, params, ...) {
281281
to_basic.GeomVline <- function(data, prestats_data, layout, params, ...) {
282282
data <- unique(data[c("PANEL", "xintercept", "group")])
283283
data$group <- seq_len(nrow(data))
284-
lay <- tidyr::gather(layout, variable, y, y_min:y_max)
284+
lay <- tidyr::gather_(layout, "variable", "y", c("y_min", "y_max"))
285285
data <- merge(lay[c("PANEL", "y")], data, by = "PANEL")
286286
data$x <- data$xintercept
287287
prefix_class(data, "GeomPath")
@@ -558,13 +558,12 @@ geom2trace.default <- function(data, params) {
558558
}
559559

560560
# ---------------------------------------------------------------------------
561-
#' Utility functions
562-
#' --------------------------------------------------------------------------
563-
#'
561+
# Utility functions
562+
# --------------------------------------------------------------------------
564563

565-
#' Drawing ggplot2 geoms with a group aesthetic is most efficient in
566-
#' plotly when we convert groups of things that look the same to
567-
#' vectors with NA.
564+
# Drawing ggplot2 geoms with a group aesthetic is most efficient in
565+
# plotly when we convert groups of things that look the same to
566+
# vectors with NA.
568567
group2NA <- function(data) {
569568
if (!"group" %in% names(data)) return(data)
570569
poly.list <- split(data, data$group, drop = TRUE)

R/plotly_IMAGE.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#'
2222

2323
plotly_IMAGE <- function(x, width = 1000, height = 500, format = "png",
24-
scale = 4, out_file, ...) {
24+
scale = 1, out_file, ...) {
2525
x <- plotly_build(x)
2626

2727
bod <- list(

R/plotly_POST.R

Lines changed: 4 additions & 4 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 'hidden', anyone with this hidden link can view this chart. It will
22+
#' If 'secret', anyone with this secret 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", "hidden")) {
39+
sharing = c("public", "private", "secret")) {
4040
x <- plotly_build(x)
4141
x$filename <- if (!missing(filename)) {
4242
filename
@@ -54,7 +54,7 @@ plotly_POST <- function(x, filename, fileopt = "new",
5454
if (!is.null(x$world_readable)) {
5555
warning('world_readable is no longer supported. Instead, set the sharing\n',
5656
'argument to "private" (you must be logged in to access),\n',
57-
'"hidden" (anybody with the obscured URL can access) or "public"\n',
57+
'"secret" (anybody with the obscured URL can access) or "public"\n',
5858
'(anybody can view).')
5959
}
6060
x$world_readable <- if (sharing[1] == "public") TRUE else FALSE
@@ -74,7 +74,7 @@ plotly_POST <- function(x, filename, fileopt = "new",
7474
base_url <- file.path(get_domain(), "clientresp")
7575
resp <- httr::POST(base_url, body = bod)
7676
con <- process(append_class(resp, "clientresp"))
77-
if (sharing[1] == "hidden") {
77+
if (sharing[1] == "secret") {
7878
bits <- strsplit(con$url, "/")[[1]]
7979
plot_id <- bits[length(bits)]
8080
url <- file.path(get_domain("api"), "v2", "files",

man/plotly_IMAGE.Rd

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

man/plotly_POST.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.

0 commit comments

Comments
 (0)