Commit a53afcf5 authored by Kautsar, Satria's avatar Kautsar, Satria
Browse files

improve heatmap color scaling for mibig metadata

parent a5fb6ab5
......@@ -1613,7 +1613,11 @@ var InCHlib;
}
if(self.settings.column_metadata){
self.column_metadata_descs = self._get_data_min_max_middle(self.column_metadata.features, "row");
if (self.settings.hasOwnProperty("column_metadata_function")) {
self.column_metadata_descs = self.settings.column_metadata_function(self.column_metadata.features); // a hack
} else {
self.column_metadata_descs = self._get_data_min_max_middle(self.column_metadata.features, "row");
}
y1 = self.header_height + 0.5*self.settings.column_metadata_row_height;
for(var i = 0, len = self.column_metadata.features.length; i < len; i++){
......
......@@ -281,7 +281,26 @@
dendrogram: true,
column_dendrogram: true,
column_metadata: true,
column_metadata_colors: "Greys",
column_metadata_colors: "YlGn",
column_metadata_function: function(features) {
var str2num = {};
str2num["0 hit"] = 0;
for (var i in features) {
for (var j in features[i]) {
if (!str2num.hasOwnProperty("" + features[i][j])) {
str2num["" + features[i][j]] = 1;
}
}
}
return {
"0": {
"min": 0,
"max": 1,
"middle": 0.5,
"str2num": str2num
}
};
},
heatmap_part_width: 0.9,
max_column_width: 15,
fixed_row_id_size: 5,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment