Skip to content

Commit 4e02b73

Browse files
committed
Merge d39157d into d9ecaf4
2 parents d9ecaf4 + d39157d commit 4e02b73

Some content is hidden

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

55 files changed

+345
-359
lines changed

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)

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.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ For more help, see https://plot.ly/R or contact <[email protected]>.")
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.

man/ggplot_build2.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/build_function.R
33
\name{ggplot_build2}
44
\alias{ggplot_build2}

man/group2NA.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/trace_generation.R
33
\name{group2NA}
44
\alias{group2NA}

man/layer2traces.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/trace_generation.R
33
\name{layer2traces}
44
\alias{layer2traces}

0 commit comments

Comments
 (0)