Skip to content

Commit

Permalink
Remove jitter workaround (#208)
Browse files Browse the repository at this point in the history
* Remove a workaround for jitter in ggplot2 <3.3.4

* Remove test
  • Loading branch information
yutannihilation authored Sep 5, 2024
1 parent 8ab5499 commit 6e829c1
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions tests/testthat/test-label.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,4 @@ test_that("generate_labelled_layer() geenrates a layer for label with ggrepel.",
l_jitter <- geom_point(aes(x, y, colour = type), d, position = position_jitter())
l_label <- generate_labelled_layer(list(l_jitter), list(g_info), type2_quo, list(fill = "white"), Inf, "ggrepel_label")
expect_equal(l_label$position$seed, l_jitter$position$seed)

# TODO: remove the following tests when gghighlight requires ggplot2 >= v3.3.4.
# when the seed is NULL, set it and share it. (c.f. tidyverse/ggplot2#2507, which is already fixed in v3.3.4)
l_jitter <- geom_point(aes(x, y, colour = type), d, position = "jitter")
if (is.null(l_jitter$position$seed)) {
l_label <- generate_labelled_layer(list(l_jitter), list(g_info), type2_quo, list(fill = "white"), Inf, "ggrepel_label")
expect_true(!is.null(l_jitter$position$seed))
expect_equal(l_label$position$seed, l_jitter$position$seed)

# Do not modify the original env
expect_true(is.null(ggplot2::PositionJitter$seed))
}
})

0 comments on commit 6e829c1

Please sign in to comment.