Browse code

Merge branch 'YuLab-SMU:master' into dev-san

William Lee authored on 22/03/2022 07:17:10 • GitHub committed on 22/03/2022 07:17:10
Showing4 changed files

... ...
@@ -31,7 +31,7 @@ Imports:
31 31
     ggfun,
32 32
     yulab.utils,
33 33
     tidyr,
34
-    tidytree (>= 0.2.6),
34
+    tidytree (>= 0.3.9),
35 35
     treeio (>= 1.8.0),
36 36
     utils,
37 37
     scales
... ...
@@ -262,6 +262,7 @@ importFrom(methods,is)
262 262
 importFrom(methods,missingArg)
263 263
 importFrom(methods,setGeneric)
264 264
 importFrom(methods,setOldClass)
265
+importFrom(pillar,style_subtle)
265 266
 importFrom(rlang,.data)
266 267
 importFrom(rlang,abort)
267 268
 importFrom(rlang,as_name)
... ...
@@ -119,7 +119,7 @@ theme_tree2_internal <- function(bgcolor="white", fgcolor="black",
119 119
 theme_inset <- function(legend.position =  "none", ...) {
120 120
     list(xlab(NULL),
121 121
          ylab(NULL),
122
-         theme_tree(legend.position =  legend.position, ...),
123
-         ggimage::theme_transparent()
122
+         theme_tree(legend.position = legend.position, ...),
123
+         ggfun::theme_transparent()
124 124
          )
125 125
 }
... ...
@@ -1,14 +1,8 @@
1 1
 ##' @importFrom utils packageDescription
2 2
 .onAttach <- function(libname, pkgname) {
3
-    pkgVersion <- packageDescription(pkgname, fields="Version")
4
-    msg <- paste0(pkgname, " v", pkgVersion, "  ",
5
-                  "For help: https://yulab-smu.top/treedata-book/", "\n\n")
6
-
7
-    citation <- paste0("If you use ", pkgname,
8
-                       " in published research, please cite the most appropriate paper(s):\n\n",
9
-                       ggtree_citations(), "\n")
10
-
11
-    packageStartupMessage(paste0(msg, citation))
3
+    pkgVersion <- packageDescription(pkgname, fields = "Version")
4
+    ref <- random_ref(pkgname = pkgname, pkgVersion = pkgVersion, random_n = 2)
5
+    if (!is.null(ref)) packageStartupMessage(ref)
12 6
 }
13 7
 
14
-
8
+random_ref <- getFromNamespace("random_ref", 'tidytree')