Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: plotly
Title: Create Interactive Web Graphics via Plotly's JavaScript Graphing Library
Version: 3.0.0
Version: 3.1.0
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
email = "cpsievert1@gmail.com"),
person("Chris", "Parmer", role = c("aut", "cph"),
Expand Down
9 changes: 8 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
3.0.0
3.1.0 -- 8 Mar 2015

CHANGES:

* The "hidden" sharing option in plotly_POST() was renamed to "secret".
* The default value in the scale argument in plotly_IMAGE() is now 1.

3.0.0 -- 8 Mar 2015

NEW FEATURES:

Expand Down
17 changes: 8 additions & 9 deletions R/layers2traces.R
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ to_basic.GeomDensity2d <- function(data, prestats_data, layout, params, ...) {
to_basic.GeomAbline <- function(data, prestats_data, layout, params, ...) {
data <- unique(data[c("PANEL", "intercept", "slope", "group")])
data$group <- seq_len(nrow(data))
lay <- tidyr::gather(layout, variable, x, x_min:x_max)
lay <- tidyr::gather_(layout, "variable", "x", c("x_min", "x_max"))
data <- merge(lay[c("PANEL", "x")], data, by = "PANEL")
data$y <- with(data, intercept + slope * x)
prefix_class(data, "GeomPath")
Expand All @@ -271,7 +271,7 @@ to_basic.GeomAbline <- function(data, prestats_data, layout, params, ...) {
to_basic.GeomHline <- function(data, prestats_data, layout, params, ...) {
data <- unique(data[c("PANEL", "yintercept", "group")])
data$group <- seq_len(nrow(data))
lay <- tidyr::gather(layout, variable, x, x_min:x_max)
lay <- tidyr::gather_(layout, "variable", "x", c("x_min", "x_max"))
data <- merge(lay[c("PANEL", "x")], data, by = "PANEL")
data$y <- data$yintercept
prefix_class(data, "GeomPath")
Expand All @@ -281,7 +281,7 @@ to_basic.GeomHline <- function(data, prestats_data, layout, params, ...) {
to_basic.GeomVline <- function(data, prestats_data, layout, params, ...) {
data <- unique(data[c("PANEL", "xintercept", "group")])
data$group <- seq_len(nrow(data))
lay <- tidyr::gather(layout, variable, y, y_min:y_max)
lay <- tidyr::gather_(layout, "variable", "y", c("y_min", "y_max"))
data <- merge(lay[c("PANEL", "y")], data, by = "PANEL")
data$x <- data$xintercept
prefix_class(data, "GeomPath")
Expand Down Expand Up @@ -558,13 +558,12 @@ geom2trace.default <- function(data, params) {
}

# ---------------------------------------------------------------------------
#' Utility functions
#' --------------------------------------------------------------------------
#'
# Utility functions
# --------------------------------------------------------------------------

#' Drawing ggplot2 geoms with a group aesthetic is most efficient in
#' plotly when we convert groups of things that look the same to
#' vectors with NA.
# Drawing ggplot2 geoms with a group aesthetic is most efficient in
# plotly when we convert groups of things that look the same to
# vectors with NA.
group2NA <- function(data) {
if (!"group" %in% names(data)) return(data)
poly.list <- split(data, data$group, drop = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion R/plotly_IMAGE.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#'

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

bod <- list(
Expand Down
8 changes: 4 additions & 4 deletions R/plotly_POST.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' Plotly to view this graph. You can privately share this graph with other
#' Plotly users in your online Plotly account and they will need to be logged
#' in to view this plot.
#' If 'hidden', anyone with this hidden link can view this chart. It will
#' If 'secret', anyone with this secret link can view this chart. It will
#' not appear in the Plotly feed, your profile, or search engines.
#' If it is embedded inside a webpage or an IPython notebook, anybody who is
#' viewing that page will be able to view the graph.
Expand All @@ -36,7 +36,7 @@
#' }

plotly_POST <- function(x, filename, fileopt = "new",
sharing = c("public", "private", "hidden")) {
sharing = c("public", "private", "secret")) {
x <- plotly_build(x)
x$filename <- if (!missing(filename)) {
filename
Expand All @@ -54,7 +54,7 @@ plotly_POST <- function(x, filename, fileopt = "new",
if (!is.null(x$world_readable)) {
warning('world_readable is no longer supported. Instead, set the sharing\n',
'argument to "private" (you must be logged in to access),\n',
'"hidden" (anybody with the obscured URL can access) or "public"\n',
'"secret" (anybody with the obscured URL can access) or "public"\n',
'(anybody can view).')
}
x$world_readable <- if (sharing[1] == "public") TRUE else FALSE
Expand All @@ -74,7 +74,7 @@ plotly_POST <- function(x, filename, fileopt = "new",
base_url <- file.path(get_domain(), "clientresp")
resp <- httr::POST(base_url, body = bod)
con <- process(append_class(resp, "clientresp"))
if (sharing[1] == "hidden") {
if (sharing[1] == "secret") {
bits <- strsplit(con$url, "/")[[1]]
plot_id <- bits[length(bits)]
url <- file.path(get_domain("api"), "v2", "files",
Expand Down
2 changes: 1 addition & 1 deletion man/plotly_IMAGE.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/plotly_POST.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.