Browse code

add show_name argument in anno_text()

Zuguang authored on 07/04/2021 08:47:30
Showing2 changed files

... ...
@@ -1,6 +1,7 @@
1 1
 CHANGES in VERSION 2.7.10
2 2
 
3 3
 * `anno_simple()`: text symbols can have nchar > 1.
4
+* `anno_text()`: add `show_name` argument.
4 5
 
5 6
 =========================
6 7
 
... ...
@@ -2052,6 +2052,7 @@ anno_density = function(x, which = c("column", "row"),
2052 2052
 #           the annotation region. 
2053 2053
 # -width Width of the annotation. The value should be an absolute unit. Width is not allowed to be set for column annotation.
2054 2054
 # -height Height of the annotation. The value should be an absolute unit. Height is not allowed to be set for row annotation.
2055
+# -show_name Whether to show the annotation name.
2055 2056
 #
2056 2057
 # == value
2057 2058
 # An annotation function which can be used in `HeatmapAnnotation`.
... ...
@@ -2077,7 +2078,7 @@ anno_density = function(x, which = c("column", "row"),
2077 2078
 anno_text = function(x, which = c("column", "row"), gp = gpar(), 
2078 2079
 	rot = guess_rot(), just = guess_just(), 
2079 2080
 	offset = guess_location(), location = guess_location(),
2080
-	width = NULL, height = NULL) {
2081
+	width = NULL, height = NULL, show_name = FALSE) {
2081 2082
 
2082 2083
 	ef = function() NULL
2083 2084
 	if(is.null(.ENV$current_annotation_which)) {
... ...
@@ -2205,7 +2206,7 @@ anno_text = function(x, which = c("column", "row"), gp = gpar(),
2205 2206
 		height = height,
2206 2207
 		n = n,
2207 2208
 		var_import = list(value, gp, just, rot, location),
2208
-		show_name = FALSE
2209
+		show_name = show_name
2209 2210
 	)
2210 2211
 
2211 2212
 	anno@subset_rule$value = subset_vector