Skip to content

Commit d6e41e6

Browse files
authored
Merge pull request #240 from animint/fix-legend
identical instead of ==
2 parents 098a05c + fd5be52 commit d6e41e6

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: animint2
22
Title: Animated Interactive Grammar of Graphics
3-
Version: 2025.9.30
3+
Version: 2025.10.3
44
URL: https://animint.github.io/animint2/
55
BugReports: https://github.com/animint/animint2/issues
66
Authors@R: c(

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Changes in version 2025.10.3 (PR#240)
2+
3+
- `guide_legend(override.aes)` works in a plot with both color and fill legends.
4+
15
# Changes in version 2025.9.30 (PR#239)
26

37
- `getCommonChunk()` has new atime performance test.

R/z_animint.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ getLegendList <- function(plistextra){
750750
}else{
751751
"legend"
752752
}
753-
if(guide.type=="colourbar")guide.type <- "legend"
753+
if(identical(guide.type,"colourbar"))guide.type <- "legend"
754754
guides.args[[aes.name]] <- guide.type
755755
}
756756
guides.result <- do.call(guides, guides.args)

tests/testthat/test-compiler-guides.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,20 @@ context("Guides")
33
test_that("colourbar trains without labels", {
44
g <- guide_colorbar()
55
sc <- scale_colour_continuous(limits = c(0, 4), labels = NULL)
6-
76
out <- guide_train(g, sc)
87
expect_equal(names(out$key), c("colour", ".value"))
98
})
109

10+
test_that("no error for override fill white", {
11+
viz <- animint(
12+
ggplot()+
13+
geom_tile(aes(
14+
x, x, color=y, fill=x),
15+
data=data.frame(x=seq(-1,1), y=0:2))+
16+
scale_color_gradient(
17+
low="white",high="black",
18+
guide=guide_legend(override.aes=list(fill="white")))+
19+
scale_fill_gradient2())
20+
info <- animint2dir(viz, open.browser = FALSE)
21+
expect_is(info, "environment")
22+
})

0 commit comments

Comments
 (0)