Skip to content

Commit

Permalink
run styler
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmbarrett committed Aug 28, 2024
1 parent 705b560 commit 3bc7a8b
Show file tree
Hide file tree
Showing 5 changed files with 317 additions and 310 deletions.
32 changes: 18 additions & 14 deletions R/ggdag-mask.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@
# TODO: when `geom_dag_label_repel2` exists, add to namespace as 1 then delete this first bit
# copied from source to avoid recursion issue in overriding in ggdag namsespace
ggdag_geom_dag_label_repel <- function(
mapping = NULL, data = NULL, parse = FALSE, ...,
box.padding = grid::unit(0.35,"lines"), label.padding = grid::unit(0.25, "lines"),
point.padding = grid::unit(1.5, "lines"), label.r = grid::unit(0.15, "lines"),
label.size = 0.25, segment.color = "grey50", segment.size = 0.5, arrow = NULL,
force = 1, max.iter = 2000, nudge_x = 0, nudge_y = 0, na.rm = FALSE,
mapping = NULL, data = NULL, parse = FALSE, ...,
box.padding = grid::unit(0.35, "lines"), label.padding = grid::unit(0.25, "lines"),
point.padding = grid::unit(1.5, "lines"), label.r = grid::unit(0.15, "lines"),
label.size = 0.25, segment.color = "grey50", segment.size = 0.5, arrow = NULL,
force = 1, max.iter = 2000, nudge_x = 0, nudge_y = 0, na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE) {
ggplot2::layer(data = data, mapping = mapping, stat = ggdag:::StatNodesRepel,
geom = ggrepel::GeomLabelRepel, position = "identity",
show.legend = show.legend, inherit.aes = inherit.aes,
params = list(parse = parse, box.padding = box.padding,
label.padding = label.padding, point.padding = point.padding,
label.r = label.r, label.size = label.size, segment.colour = segment.color %||%
segment.colour, segment.size = segment.size,
arrow = arrow, na.rm = na.rm, force = force, max.iter = max.iter,
nudge_x = nudge_x, nudge_y = nudge_y, segment.alpha = 1, ...))
ggplot2::layer(
data = data, mapping = mapping, stat = ggdag:::StatNodesRepel,
geom = ggrepel::GeomLabelRepel, position = "identity",
show.legend = show.legend, inherit.aes = inherit.aes,
params = list(
parse = parse, box.padding = box.padding,
label.padding = label.padding, point.padding = point.padding,
label.r = label.r, label.size = label.size, segment.colour = segment.color %||%
segment.colour, segment.size = segment.size,
arrow = arrow, na.rm = na.rm, force = force, max.iter = max.iter,
nudge_x = nudge_x, nudge_y = nudge_y, segment.alpha = 1, ...
)
)
}

geom_dag_label_repel_internal <- function(..., seed = 10) {
Expand Down
Loading

0 comments on commit 3bc7a8b

Please sign in to comment.