Skip to content

Commit 0913091

Browse files
committed
Merge branch 'master' into feature/sf
2 parents b23c6f4 + 96526fc commit 0913091

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
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.js'
3-
Version: 4.6.0
3+
Version: 4.6.0.9000
44
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
55
email = "[email protected]"),
66
person("Chris", "Parmer", role = "aut",

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 4.6.0.9000
2+
3+
## Bug fixes
4+
5+
* When creating private plots via `api_create()`, both the plot and the data behind the plot are private (fixes #976).
6+
* Fixed bug when highlight multiple 'simple key' traces (fixes #974)
7+
18
# 4.6.0
29

310
## NEW FEATURES & IMPROVEMENTS

R/api.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ api_create_plot <- function(x = last_plot(), filename = NULL,
1313
# in v2, traces must reference grid data, so create grid references first
1414
# http://moderndata.plot.ly/simple-rest-apis-for-charts-and-datasets/
1515
for (i in seq_along(x$data)) {
16-
x$data[[i]] <- api_srcify(x$data[[i]])
16+
x$data[[i]] <- api_srcify(x$data[[i]], sharing = sharing)
1717
}
1818

1919
# same for animation frames
2020
for (i in seq_along(x$frames)) {
2121
frame <- x$frames[[i]]
2222
for (j in seq_along(frame$data)) {
23-
x$frames[[i]]$data[[j]] <- api_srcify(frame$data[[j]])
23+
x$frames[[i]]$data[[j]] <- api_srcify(frame$data[[j]], sharing = sharing)
2424
}
2525
}
2626

@@ -125,7 +125,7 @@ api_trash_file <- function(file) {
125125

126126
# upload a grid of data array attributes, attach src references to the trace,
127127
# and remove the actual data from trace
128-
api_srcify <- function(trace) {
128+
api_srcify <- function(trace, sharing = "public") {
129129
Attrs <- Schema$traces[[trace[["type"]]]]$attributes
130130
isArray <- vapply(
131131
Attrs, function(x) tryFALSE(identical(x[["valType"]], "data_array")), logical(1)
@@ -134,7 +134,7 @@ api_srcify <- function(trace) {
134134
grid <- trace[names(trace) %in% names(Attrs)[isArray | arrayOK]]
135135
# create the grid and replace actual data with "src pointers"
136136
if (length(grid)) {
137-
resp <- api_create_grid(grid, filename = new_id())
137+
resp <- api_create_grid(grid, filename = new_id(), sharing = sharing)
138138
fid <- resp[["fid"]]
139139
cols <- resp[["cols"]]
140140
for (j in seq_along(cols)) {

0 commit comments

Comments
 (0)