Commit id: 4cbce102eabb1633fc8980b1374795bfb44507df
Merge branch 'master' of https://github.com/jokergoo/ComplexHeatmap
Commit id: a15bbec76c85c15bc27273ce15f5118ea087132f
refreshed documentatinos
Commit id: b1fe0a94aa09a4a47e5a02383ce662580f057bdc
ColorMapping object has default value for name slot
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/ComplexHeatmap@106487 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -1,5 +1,6 @@ |
1 | 1 |
CHANGES in VERSION 1.2.4 |
2 | 2 |
|
3 |
+* name for ColorMapping object has default value now. |
|
3 | 4 |
* legend for continuous values can be set as continuous legends |
4 | 5 |
* row title and column title as well as legend title support expression |
5 | 6 |
* add `heatmap_legend_title` in `Heatmap` and `ColorMapping` |
... | ... |
@@ -67,8 +67,9 @@ ColorMapping = function(name, colors = NULL, levels = NULL, |
67 | 67 |
|
68 | 68 |
.Object = new("ColorMapping") |
69 | 69 |
|
70 |
- if(is.null(name)) { |
|
71 |
- stop("You should provide name.") |
|
70 |
+ if(missing(name)) { |
|
71 |
+ increase_color_mapping_index() |
|
72 |
+ name = get_color_mapping_index() |
|
72 | 73 |
} |
73 | 74 |
if(!is.null(colors)) { |
74 | 75 |
if(is.null(levels)) { |
... | ... |
@@ -5,6 +5,7 @@ INDEX_ENV = new.env() |
5 | 5 |
INDEX_ENV$I_HEATMAP = 0 |
6 | 6 |
INDEX_ENV$I_ANNOTATION = 0 |
7 | 7 |
INDEX_ENV$I_ROW_ANNOTATION = 0 |
8 |
+INDEX_ENV$I_COLOR_MAPPING = 0 |
|
8 | 9 |
|
9 | 10 |
get_heatmap_index = function() { |
10 | 11 |
INDEX_ENV$I_HEATMAP |
... | ... |
@@ -30,6 +31,13 @@ increase_row_annotation_index = function() { |
30 | 31 |
INDEX_ENV$I_ROW_ANNOTATION = INDEX_ENV$I_ROW_ANNOTATION + 1 |
31 | 32 |
} |
32 | 33 |
|
34 |
+get_color_mapping_index = function() { |
|
35 |
+ INDEX_ENV$I_COLOR_MAPPING |
|
36 |
+} |
|
37 |
+ |
|
38 |
+increase_color_mapping_index = function() { |
|
39 |
+ INDEX_ENV$I_COLOR_MAPPING = INDEX_ENV$I_COLOR_MAPPING + 1 |
|
40 |
+} |
|
33 | 41 |
|
34 | 42 |
# default colors for matrix or annotations |
35 | 43 |
# this function should be improved later |
... | ... |
@@ -20,6 +20,7 @@ This function is only for internal use. |
20 | 20 |
|
21 | 21 |
} |
22 | 22 |
\section{Detials}{ |
23 |
+ |
|
23 | 24 |
This function is only for internal use.} |
24 | 25 |
\value{ |
25 | 26 |
A \code{\link[grid]{unit}} object. |
... | ... |
@@ -30,4 +31,5 @@ Zuguang Gu <z.gu@dkfz.de> |
30 | 31 |
|
31 | 32 |
} |
32 | 33 |
\examples{ |
34 |
+ |
|
33 | 35 |
# no example for this internal method} |