Skip to content

Commit

Permalink
fill transparent fails
Browse files Browse the repository at this point in the history
  • Loading branch information
tdhock committed Mar 13, 2016
1 parent 9fcc4c3 commit 35d5460
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/testthat/test-renderer3-point-fill-NA.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
acontext("point fill NA")

##dput(RColorBrewer::brewer.pal(Inf, "Set1"))
species.colors <-
c(versicolor="#E41A1C",
setosa="#377EB8",
virginica="#4DAF4A", "#984EA3",
"#FF7F00", "#FFFF33",
"#A65628", "#F781BF", "#999999")
viz <- list(
petals=ggplot()+
scale_color_manual(values=species.colors)+
geom_point(aes(Petal.Length, Petal.Width, color=Species),
fill=NA,
shape=21,
data=iris)
)

test_that("geom_point(aes(color), fill=NA) renders fill transparent", {
info <- animint2HTML(viz)
style.mat <- getStyleValue(
info$html, '//g[@class="geom1_point_petals"]//circle', c("fill", "stroke"))
expected.stroke <- species.colors[paste(iris$Species)]
expect_color(style.mat["stroke", ], expected.stroke)
expected.fill <- rep("transparent", nrow(iris))
expect_color(style.mat["fill", ], expected.fill)
})

0 comments on commit 35d5460

Please sign in to comment.