Skip to content

Commit 3df8f86

Browse files
committed
Merge branch 'master' of github.com:ropensci/plotly into fix/ns
2 parents dca6b82 + 99c7368 commit 3df8f86

File tree

11 files changed

+185
-135
lines changed

11 files changed

+185
-135
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.3.5
3+
Version: 4.3.6
44
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
55
email = "[email protected]"),
66
person("Chris", "Parmer", role = c("aut", "cph"),

NEWS.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
# 4.3.5 --
1+
# 4.3.6 -- 9 September 2016
2+
3+
## CHANGES
4+
5+
* Upgraded to plotly.js v1.17.0 -- https://github.com/plotly/plotly.js/releases/tag/v1.17.0
6+
7+
## BUG FIXES
8+
9+
* Fix for error handling in `add_bars()`.
10+
* More careful logic for inferring data variables. Fixes #712
11+
12+
# 4.3.5 -- 5 September 2016
213

314
## NEW FEATURES
415

R/add.R

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ add_area <- function(p, x = NULL, ymax = NULL, ...) {
274274
add_bars <- function(p, x = NULL, y = NULL, ...) {
275275
x <- x %||% p$x$attrs[[1]][["x"]]
276276
y <- y %||% p$x$attrs[[1]][["y"]]
277-
if (is.null(x) && is.null(y)) {
278-
stop("Must supply `x` and/or `y` attributes", call. = FALSE)
277+
if (is.null(x) || is.null(y)) {
278+
stop("Must supply `x` and `y` attributes", call. = FALSE)
279279
}
280280
# TODO: provide type checking in plotly_build for this trace type
281281
add_trace_classed(
@@ -451,6 +451,17 @@ add_trace_classed <- function(p, class = "plotly_polygon", ...) {
451451
p
452452
}
453453

454+
# retrieve the non-plotly.js attributes for a given trace
455+
special_attrs <- function(trace) {
456+
switch(
457+
class(trace)[[1]],
458+
plotly_area = c("ymax"),
459+
plotly_segment = c("xend", "yend"),
460+
plotly_ribbon = c("ymin", "ymax")
461+
)
462+
}
463+
464+
454465

455466
# #'
456467
# #'

R/plotly_POST.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#' @author Carson Sievert
3232
#' @examples
3333
#' \dontrun{
34-
#' p <- plot_ly(mtcars, x = vs, type = "bar")
34+
#' p <- plot_ly(mtcars, x = ~factor(vs))
3535
#' plotly_POST(p, filename = "mtcars-bar-plot")
3636
#' }
3737

0 commit comments

Comments
 (0)