gt_render: Mark the text for the rendering by gridtext package

Description Usage Arguments Details Examples

View source: R/gridtext.R

Description

Mark the text for the rendering by gridtext package

Usage

1

Arguments

x

Text labels. The value can be a vector.

...

Other parameters passed to richtext_grob.

Details

Text marked by gt_render will be rendered by richtext_grob function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if(requireNamespace("gridtext")) {
mat = matrix(rnorm(100), 10)
rownames(mat) = letters[1:10]
ht = Heatmap(mat, 
	column_title = gt_render("Some <span style='color:blue'>blue text **in bold.**</span><br>And *italics text.*<br>And some <span style='font-size:18pt; color:black'>large</span> text.", r = unit(2, "pt"), padding = unit(c(2, 2, 2, 2), "pt")),
	column_title_gp = gpar(box_fill = "orange"),
	row_labels = gt_render(letters[1:10], padding = unit(c(2, 10, 2, 10), "pt")),
	row_names_gp = gpar(box_col = "red"),
	row_km = 2, 
	row_title = gt_render(c("title1", "title2")), 
	row_title_gp = gpar(box_fill = "yellow"),
	heatmap_legend_param = list(
		title = gt_render("<span style='color:orange'>**Legend title**</span>"), 
		title_gp = gpar(box_fill = "grey"),
		at = c(-3, 0, 3), 
		labels = gt_render(c("*negative* three", "zero", "*positive* three"))
	))
ht = rowAnnotation(
	foo = anno_text(gt_render(sapply(LETTERS[1:10], strrep, 10), align_widths = TRUE), 
	                gp = gpar(box_col = "blue", box_lwd = 2), 
	                just = "right", 
	                location = unit(1, "npc")
	)) + ht
draw(ht)

}

ComplexHeatmap documentation built on Nov. 14, 2020, 2:01 a.m.