Skip to content

Commit bfb23c7

Browse files
committed
Merge pull request #182 from ropensci/carson-ribbon-fix
Fix #181
2 parents 379b0f0 + f236afe commit bfb23c7

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
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.22
4+
Version: 0.5.23
55
Authors@R: c(person("Chris", "Parmer", role = c("aut", "cre"),
66
email = "[email protected]"),
77
person("Scott", "Chamberlain", role = "aut",

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.5.23 -- 10 March 2015.
2+
3+
geom_ribbon now respects alpha transparency
4+
15
0.5.22 -- 2 March 2015.
26

37
Fixes for ylim() #171.

R/trace_generation.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ geom2trace <- list(
613613
type="scatter",
614614
line=paramORdefault(params, aes2line, ribbon.line.defaults),
615615
fill="tonexty",
616-
fillcolor=toFill(params$fill))
616+
fillcolor=toFill(params$fill, ifelse(is.null(params$alpha), 1,
617+
params$alpha)))
617618
},
618619
abline=function(data, params) {
619620
list(x=c(params$xstart, params$xend),

tests/testthat/test-ggplot-ribbon.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ test_that("sanity check for geom_ribbon", {
1414
})
1515

1616
save_outputs(rb, "ribbon")
17+
18+
rb2 <- ggplot(huron, aes(x=year)) +
19+
geom_ribbon(aes(ymin=level-1, ymax=level+1), alpha = 0.1)
20+
L2 <- gg2list(rb2)
21+
22+
test_that("geom_ribbon respects alpha transparency", {
23+
expect_match(L2[[1]]$fillcolor, "0.1)", fixed=TRUE)
24+
})
25+
26+
save_outputs(rb2, "ribbon-alpha")

0 commit comments

Comments
 (0)