Skip to content

Commit f8eedaa

Browse files
committed
Merge branch 'master' of github.com:ropensci/plotly into fix/subplot
2 parents c61675f + 2748789 commit f8eedaa

File tree

11 files changed

+89
-49
lines changed

11 files changed

+89
-49
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
CONDUCT.md
66
CONTRIBUTING.md
77
build_site.R
8+
todo.R
89
inst/examples/flexdashboard

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ build_site.R
88
todo.R
99
inst/examples/*/*.html
1010
inst/examples/*/rsconnect/*
11+
.Rproj.user

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

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ importFrom(jsonlite,toJSON)
8787
importFrom(magrittr,"%>%")
8888
importFrom(plyr,ddply)
8989
importFrom(plyr,summarise)
90+
importFrom(stats,complete.cases)
9091
importFrom(stats,setNames)
9192
importFrom(tidyr,gather)
9293
importFrom(utils,browseURL)

NEWS

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
3.4.15 -- 18 Apr 2016
2+
3+
BUGFIX:
4+
5+
The alpha in geom_smooth was incorrectly inheriting from other layers. See #551.
6+
7+
3.4.14 -- 15 Apr 2016
8+
9+
CHANGES:
10+
11+
Upgrade to plotlyjs v1.9.0 -- https://github.com/plotly/plotly.js/releases/tag/v1.9.0
12+
13+
3.4.13 -- 6 Apr 2016
14+
15+
BUGFIX:
16+
17+
In some cases, marker color was inheriting from the marker line color when
18+
it shouldn't have. See ##537.
19+
120
3.4.12 -- 5 Apr 2016
221

322
CHANGES:

R/ggplotly.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ gg2list <- function(p, width = NULL, height = NULL, tooltip = "all", source = "A
232232
# attach a new column (hovertext) to each layer of data that should get mapped
233233
# to the text trace property
234234
data <- Map(function(x, y) {
235+
if (nrow(x) == 0) return(x)
235236
# make sure the relevant aes exists in the data
236237
for (i in seq_along(y)) {
237238
aesName <- names(y)[[i]]

R/imports.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' @import ggplot2
22
#' @importFrom grDevices col2rgb
33
#' @importFrom utils getFromNamespace modifyList data packageVersion browseURL
4-
#' @importFrom stats setNames
4+
#' @importFrom stats setNames complete.cases
55
#' @importFrom tidyr gather
66
#' @importFrom plyr ddply summarise
77
#' @importFrom viridis viridis

R/layers2traces.R

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ to_basic.GeomBoxplot <- function(data, prestats_data, layout, params, p, ...) {
141141
#' @export
142142
to_basic.GeomSmooth <- function(data, prestats_data, layout, params, p, ...) {
143143
dat <- prefix_class(data, "GeomPath")
144-
dat$alpha <- NULL
144+
# alpha for the path is always 1 (see GeomSmooth$draw_key)
145+
dat$alpha <- 1
145146
if (!identical(params$se, FALSE)) {
146147
dat2 <- prefix_class(ribbon_dat(data), c("GeomPolygon", "GeomSmooth"))
147148
dat2$colour <- NULL
@@ -395,6 +396,7 @@ geom2trace.GeomPath <- function(data, params, p) {
395396
#' @export
396397
geom2trace.GeomPoint <- function(data, params, p) {
397398
shape <- aes2plotly(data, params, "shape")
399+
color <- aes2plotly(data, params, "colour")
398400
L <- list(
399401
x = data$x,
400402
y = data$y,
@@ -404,21 +406,20 @@ geom2trace.GeomPoint <- function(data, params, p) {
404406
mode = "markers",
405407
marker = list(
406408
autocolorscale = FALSE,
407-
color = aes2plotly(data, params, "fill"),
409+
color = color,
408410
opacity = aes2plotly(data, params, "alpha"),
409411
size = aes2plotly(data, params, "size"),
410412
symbol = shape,
411413
line = list(
412414
width = aes2plotly(data, params, "stroke"),
413-
color = aes2plotly(data, params, "colour")
415+
color = color
414416
)
415417
)
416418
)
417-
# fill is irrelevant for pch %in% c(1, 15:20)
419+
# fill is only relevant for pch %in% 21:25
418420
pch <- uniq(data$shape) %||% params$shape %||% GeomPoint$default_aes$shape
419-
if (any(pch %in% c(1, 15:20)) ||
420-
all(grepl("open$", shape)) && all(L$marker$color %in% "transparent")) {
421-
L$marker$color <- L$marker$line$color
421+
if (any(idx <- pch %in% 21:25)) {
422+
L$marker$color[idx] <- aes2plotly(data, params, "fill")[idx]
422423
}
423424
L
424425
}
@@ -538,7 +539,7 @@ geom2trace.GeomTile <- function(data, params, p) {
538539
# create the colorscale
539540
colScale <- unique(g[, c("fill_plotlyDomain", "fill")])
540541
# colorscale goes crazy if there are NAs
541-
colScale <- colScale[complete.cases(colScale), ]
542+
colScale <- colScale[stats::complete.cases(colScale), ]
542543
colScale <- colScale[order(colScale$fill_plotlyDomain), ]
543544
list(
544545
x = x,

inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js

Lines changed: 39 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/htmlwidgets/plotly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: plotlyjs
3-
version: 1.8.0
3+
version: 1.9.0
44
src: "htmlwidgets/lib/plotlyjs"
55
script: plotly-latest.min.js
66
stylesheet: plotly-htmlwidgets.css

0 commit comments

Comments
 (0)