Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added three new aesthetics #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 6 additions & 4 deletions R/geom-label-repel.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ GeomLabelRepel <- ggproto(
colour = "black", fill = "white", size = 3.88, angle = 0,
alpha = NA, family = "", fontface = 1, lineheight = 1.2,
hjust = 0.5, vjust = 0.5, point.size = 1,
segment.linetype = 1, segment.colour = NULL, segment.size = 0.5, segment.alpha = NULL,
label.col.alpha = NULL, label.fill.alpha = NULL,
segment.linetype = 1, segment.linewidth = 1,
segment.colour = NULL, segment.size = 0.5, segment.alpha = NULL,
segment.curvature = 0, segment.angle = 90, segment.ncp = 1,
segment.shape = 0.5, segment.square = TRUE, segment.squareShape = 1,
segment.inflect = FALSE, segment.debug = FALSE
Expand Down Expand Up @@ -351,13 +353,13 @@ makeContent.labelrepeltree <- function(x) {
lineheight = row$lineheight
),
rect.gp = gpar(
col = scales::alpha(row$colour, row$alpha),
fill = scales::alpha(row$fill, row$alpha),
col = scales::alpha(row$colour, row$label.col.alpha %||% row$alpha),
fill = scales::alpha(row$fill, row$label.fill.alpha %||% row$alpha),
lwd = x$label.size * .pt
),
segment.gp = gpar(
col = scales::alpha(row$segment.colour %||% row$colour, row$segment.alpha %||% row$alpha),
lwd = row$segment.size * .pt,
lwd = (row$segment.size * .pt) %||% row$segment.linewidth,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the default value for segment.size is 0.5, the value for segment.linewidth will not be used.

I'm willing to have another look at this suggestion, if you can help me to understand the intent of this change and how it should work for users. Backward compatibility is important to me, so I want to try to avoid breaking old code if possible.

lty = row$segment.linetype %||% 1
),
arrow = x$arrow,
Expand Down