mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 12:13:33 +08:00
Charts: Add labels
This commit is contained in:
@@ -25,6 +25,7 @@ return Backbone.View.extend(
|
||||
|
||||
// default settings
|
||||
optionsDefault: {
|
||||
title : '',
|
||||
pace : 1000,
|
||||
margin : {
|
||||
top : 50,
|
||||
@@ -231,12 +232,32 @@ return Backbone.View.extend(
|
||||
this.colSortOrder = false;
|
||||
|
||||
// build
|
||||
this.rowLabels = this._buildRowLabels();
|
||||
this.colLabels = this._buildColLabels();
|
||||
this.heatMap = this._buildHeatMap();
|
||||
this.legend = this._buildLegend();
|
||||
this._buildRowLabels();
|
||||
this._buildColLabels();
|
||||
this._buildHeatMap();
|
||||
this._buildLegend();
|
||||
this._buildTitle();
|
||||
},
|
||||
|
||||
// build title
|
||||
_buildTitle: function() {
|
||||
// link this
|
||||
var self = this;
|
||||
|
||||
// gather data
|
||||
var height = this.height;
|
||||
var width = this.width;
|
||||
var title = this.options.title;
|
||||
|
||||
// add title
|
||||
this.svg.append('g')
|
||||
.append('text')
|
||||
.attr('x', width / 2)
|
||||
.attr('y', height - 10)
|
||||
.attr('text-anchor', 'middle')
|
||||
.text(title);
|
||||
},
|
||||
|
||||
// build legend
|
||||
_buildLegend: function() {
|
||||
// link this
|
||||
|
||||
@@ -22,12 +22,14 @@ return Backbone.View.extend(
|
||||
for (var group_index in request_dictionary.groups) {
|
||||
// get group
|
||||
var group = request_dictionary.groups[group_index];
|
||||
|
||||
var div = self.options.canvas[group_index];
|
||||
|
||||
// draw plot
|
||||
var heatmap = new HeatmapPlugin({
|
||||
'colors' : HeatmapParameters.colorSets[chart.settings.get('color_set')],
|
||||
'data' : group.values,
|
||||
'div' : self.options.canvas[group_index]
|
||||
'title' : group.key,
|
||||
'colors' : HeatmapParameters.colorSets[chart.settings.get('color_set')],
|
||||
'data' : group.values,
|
||||
'div' : div
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user