From 38b14fd3c8f65024cb120f7e5690cf3a48884524 Mon Sep 17 00:00:00 2001 From: Guangchuang Yu Date: Thu, 20 Aug 2020 12:47:34 +0800 Subject: [PATCH] solved #105 --- DESCRIPTION | 4 ++-- NEWS.md | 5 +++++ R/sticker.R | 13 +++++++++---- README.md | 1 + 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a1ba782..8d17b7f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: hexSticker Title: Create Hexagon Sticker in R -Version: 0.4.7 +Version: 0.4.8 Authors@R: c(person(given = "Guangchuang", family = "Yu", email = "guangchuangyu@gmail.com", role = c("aut", "cre")), person(given = "Laurent", family = "Gatto", email = "lg390@cam.ac.uk", role = "ctb"), person(given = "Johannes", family = "Rainer", email = "johannes.rainer@eurac.edu", role = "ctb"), @@ -27,5 +27,5 @@ URL: https://github.com/GuangchuangYu/hexSticker BugReports: https://github.com/GuangchuangYu/hexSticker/issues Encoding: UTF-8 LazyData: true -RoxygenNote: 7.1.0 +RoxygenNote: 7.1.1 Roxygen: list(markdown = TRUE) diff --git a/NEWS.md b/NEWS.md index a4acccb..99f4517 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# CHANGES IN VERSION 0.4.8 + ++ support passing `expression()` as package name (via the `package` parameter) (2020-08-20, Thu) + - + # CHANGES IN VERSION 0.4.7 + use Cairo and enable Antialias when saving sticker on Windows (2020-06-01, Mon) diff --git a/R/sticker.R b/R/sticker.R index 32cdec9..9c1cba4 100644 --- a/R/sticker.R +++ b/R/sticker.R @@ -146,10 +146,15 @@ spotlight <- function(alpha) { ##' @author Guangchuang Yu geom_pkgname <- function(package, x=1, y=1.4, color="#FFFFFF", family="Aller_Rg", size=8, ...) { family <- load_font(family) - d <- data.frame(x = x, y = y, - label = package) - geom_text(aes_(x=~x, y=~y, label=~label), d, - size=size, color=color, family = family, ...) + ## d <- data.frame(x = x, y = y, + ## label = package) + ## geom_text(aes_(x=~x, y=~y, label=~label), d, + ## size=size, color=color, family = family, ...) + + + ## https://github.com/GuangchuangYu/hexSticker/issues/105 + ggplot2::annotate("text", x = x, y = y, size = size, + label = package, color = color, family = family, ...) } ##' @importFrom sysfonts font_add diff --git a/README.md b/README.md index d27ab7a..6f3b891 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,7 @@ sticker(p, package="hexSticker", p_size=22, s_x=1, s_y=.75, s_width=1.3, s_heigh [](https://github.com/MEDSL/ggmedsl) [](https://github.com/muschellij2/glassdoor) [](https://github.com/greta-dev/greta/tree/master/logos) +[](https://github.com/calvinmfloyd/grobblR) [](https://github.com/mikemahoney218/heddlr) [](https://github.com/SteffenMoritz/imputeR) [](https://github.com/lpantano/isomiRs)