commit/galaxy-central: guerler: Charts: Add labels
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/fd8cf2329753/ Changeset: fd8cf2329753 User: guerler Date: 2014-05-03 02:12:26 Summary: Charts: Add labels Affected #: 2 files diff -r 21121d6283a95942061819f5e788ab41cfc1c000 -r fd8cf23297536147d5bbeed5b8b5d501eb8e84bf config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js --- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js +++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js @@ -25,6 +25,7 @@ // default settings optionsDefault: { + title : '', pace : 1000, margin : { top : 50, @@ -231,12 +232,32 @@ 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 diff -r 21121d6283a95942061819f5e788ab41cfc1c000 -r fd8cf23297536147d5bbeed5b8b5d501eb8e84bf config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js --- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js +++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js @@ -22,12 +22,14 @@ 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 }); } Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org