Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions inst/htmljs/animint.js
Original file line number Diff line number Diff line change
Expand Up @@ -1134,12 +1134,18 @@ var animint = function (to_select, json_file) {
var get_style_on_stroke_width = get_size;

// stroke_width for geom_point
var stroke_width = 1; // by default ggplot2 has 0.5, animint has 1
var stroke_width = 1; // default

// Make stroke more visible when color_off is used
if(aes.hasOwnProperty("color_off")){
stroke_width = 2;
}

var get_stroke_width;
if(aes.hasOwnProperty("stroke")){
get_stroke_width = get_attr("stroke");
get_stroke_width = get_attr("stroke");
}else{
get_stroke_width = function(d){
get_stroke_width = function(d){
return stroke_width;
};
}
Expand Down
20 changes: 20 additions & 0 deletions tests/testthat/test-renderer-selectors.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
test_that("animint renderer works without Selectors.hasOwnProperty", {
skip_on_cran()

library(animint2)

df <- data.frame(
x = 1:3,
y = 1:3,
grp = c("a", "b", "c")
)

p <- ggplot(df, aes(x, y)) +
geom_point(clickSelects = "grp")

tmp <- withr::local_tempdir()

expect_silent(
animint(list(plot = p), out.dir = tmp)
)
})