Skip to content

Commit 512b5b5

Browse files
committed
Merge aff2997 into d9ecaf4
2 parents d9ecaf4 + aff2997 commit 512b5b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+353
-363
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: plotly
22
Type: Package
33
Title: Interactive, publication-quality graphs online.
4-
Version: 0.5.29
4+
Version: 0.5.30
55
Authors@R: c(person("Chris", "Parmer", role = c("aut", "cre"),
66
email = "[email protected]"),
77
person("Scott", "Chamberlain", role = "aut",

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by roxygen2 (4.1.0): do not edit by hand
1+
# Generated by roxygen2 (4.1.1): do not edit by hand
22

33
export(gg2list)
44
export(ggplot_build2)

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.5.30 -- 4 May 2015
2+
3+
Let gg2list() return a figure object.
4+
15
0.5.29 -- 16 April 2015
26

37
geom_density() as filled area chart #202

R/ggplotly.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ markUnique <- as.character(unique(unlist(markLegends)))
7070
#' Convert a ggplot to a list.
7171
#' @import ggplot2
7272
#' @param p ggplot2 plot.
73-
#' @return list representing a ggplot.
73+
#' @return figure object (list with names "data" and "layout").
7474
#' @export
75-
gg2list <- function(p){
75+
gg2list <- function(p) {
7676
if(length(p$layers) == 0) {
7777
stop("No layers in plot")
7878
}
@@ -886,7 +886,8 @@ gg2list <- function(p){
886886
flipped.layout[["yaxis"]] <- x
887887
}
888888

889-
flipped.traces$kwargs <- list(layout=flipped.layout)
889+
fig <- list(data=flipped.traces, layout=flipped.layout)
890+
891+
fig
890892

891-
flipped.traces
892893
}

R/plotly-package.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#' \itemize{
88
#' \item Package: plotly
99
#' \item Type: Package
10-
#' \item Version: 0.5.20
10+
#' \item Version: 0.5.30
1111
#' \item Date: 2014-03-07
1212
#' \item License: MIT
1313
#' }

R/plotly.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ For more help, see https://plot.ly/R or contact <[email protected]>.")
8282

8383
# public attributes/methods that the user has access to
8484
pub <- list(username=username, key=key, filename="from api", fileopt=NULL,
85-
version="0.5.20")
85+
version="0.5.30")
8686
priv <- list()
8787

8888
pub$makecall <- function(args, kwargs, origin) {
8989
if (is.null(kwargs$filename))
9090
kwargs$filename <- pub$filename
9191
if (is.null(kwargs$fileopt))
92-
kwargs$fileopt <- NULL
92+
kwargs$fileopt <- pub$fileopt
9393
url <- paste(base_url, "/clientresp", sep="")
9494

9595
respst <- postForm(url, platform="R", version=pub$version,
@@ -139,11 +139,15 @@ For more help, see https://plot.ly/R or contact <[email protected]>.")
139139
if(!is.ggplot(gg)){
140140
stop("gg must be a ggplot")
141141
}
142-
pargs <- gg2list(gg)
142+
fig <- gg2list(gg)
143143
if (!"auto_open" %in% names(kwargs)) {
144144
kwargs <- c(kwargs, auto_open=TRUE)
145145
}
146-
pargs$kwargs <- c(pargs$kwargs, kwargs)
146+
147+
pargs <- fig$data
148+
pargs$kwargs <- kwargs
149+
pargs$kwargs$layout <- fig$layout
150+
147151
if (session == "interactive") { # we are on the command line
148152
resp <- do.call(pub$plotly, pargs)
149153
if (pargs$kwargs$auto_open) {

man/ensure_file_exist.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Generated by roxygen2 (4.1.0): do not edit by hand
1+
% Generated by roxygen2 (4.1.1): do not edit by hand
22
% Please edit documentation in R/tools.R
33
\name{ensure_file_exist}
44
\alias{ensure_file_exist}

man/get_config_file.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Generated by roxygen2 (4.1.0): do not edit by hand
1+
% Generated by roxygen2 (4.1.1): do not edit by hand
22
% Please edit documentation in R/tools.R
33
\name{get_config_file}
44
\alias{get_config_file}

man/get_credentials_file.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Generated by roxygen2 (4.1.0): do not edit by hand
1+
% Generated by roxygen2 (4.1.1): do not edit by hand
22
% Please edit documentation in R/tools.R
33
\name{get_credentials_file}
44
\alias{get_credentials_file}

man/gg2list.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Generated by roxygen2 (4.1.0): do not edit by hand
1+
% Generated by roxygen2 (4.1.1): do not edit by hand
22
% Please edit documentation in R/ggplotly.R
33
\name{gg2list}
44
\alias{gg2list}
@@ -10,7 +10,7 @@ gg2list(p)
1010
\item{p}{ggplot2 plot.}
1111
}
1212
\value{
13-
list representing a ggplot.
13+
figure object (list with names "data" and "layout").
1414
}
1515
\description{
1616
Convert a ggplot to a list.

0 commit comments

Comments
 (0)