Skip to content

Commit

Permalink
Remove a workaround for jitter in ggplot2 <3.3.4 (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation authored Sep 5, 2024
1 parent df3bdee commit 8ab5499
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions R/gghighlight.R
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ clone_layer <- function(layer, layer_name_suffix = NULL) {
new_layer
}

clone_position <- clone_layer

calculate_group_info <- function(data, mapping, extra_vars = NULL) {
mapping <- purrr::compact(mapping)
# the calculation may be possible only in the ggplot2 context (e.g. stat()).
Expand Down
7 changes: 0 additions & 7 deletions R/label.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,6 @@ generate_label_for_point <- function(layer, label_key, label_params, max_labels)
mapping <- layer$mapping
mapping$label <- label_key

if (inherits(layer$position, "PositionJitter") && is.null(layer$position$seed)) {
# FIXME when this is fixed on upstream: https://github.com/tidyverse/ggplot2/issues/2507
position <- clone_position(layer$position)
position$seed <- sample.int(.Machine$integer.max, 1L)
layer$position <- position
}

label_params$position <- layer$position

inject(ggrepel::geom_label_repel(mapping, layer$data, !!!label_params))
Expand Down

0 comments on commit 8ab5499

Please sign in to comment.