Skip to content

Commit 465ae63

Browse files
test label and tweak default params
1 parent ea80907 commit 465ae63

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

R/geom_text_lastonly_new.R

+7-5
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ GeomTextLastNew <- ggproto(
229229
required_aes = c("x", "y"),
230230

231231
default_aes = aes(
232-
colour = "black", size = 3.88, angle = 0,
232+
colour = "black", size = 3.88, angle = 0, label = NA,
233233
alpha = NA, family = "", fontface = 1, lineheight = 1.2,
234-
hjust = 0.5, vjust = 0.5, point.size = 1,
234+
hjust = 0, vjust = 0.5, point.size = 1,
235235
segment.linetype = 1, segment.colour = NULL, segment.size = 0.5, segment.alpha = NULL,
236236
segment.curvature = 0, segment.angle = 90, segment.ncp = 1,
237237
segment.shape = 0.5, segment.square = TRUE, segment.squareShape = 1,
@@ -258,7 +258,7 @@ GeomTextLastNew <- ggproto(
258258
nudge_y = 0,
259259
xlim = c(NA, NA),
260260
ylim = c(NA, NA),
261-
direction = "both",
261+
direction = "y",
262262
seed = NA,
263263
verbose = FALSE
264264
) {
@@ -347,6 +347,7 @@ GeomTextLastNew <- ggproto(
347347
verbose = verbose,
348348
cl = "textlastrepel"
349349
))
350+
350351
},
351352

352353
draw_key = draw_key_text
@@ -384,9 +385,10 @@ makeContent.textlastrepel <- function(x) {
384385
hjust = row$hjust,
385386
vjust = row$vjust,
386387
gp = gpar(
387-
fontsize = row$size * .pt,
388+
col = alpha(row$colour, row$alpha),
389+
fontsize = row$size * .pt,
388390
fontfamily = row$family,
389-
fontface = row$fontface,
391+
fontface = row$fontface,
390392
lineheight = row$lineheight
391393
)
392394
)

0 commit comments

Comments
 (0)