1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b3b39af86c36/ Changeset: b3b39af86c36 User: guerler Date: 2014-04-10 16:00:54 Summary: Charts: Add label selection columns Affected #: 6 files
diff -r a146d1007651d7f08240d39f0ac18a2491207bc7 -r b3b39af86c36a4f141bbe64dfec4ad59f3facbe7 config/plugins/visualizations/charts/static/app.js --- a/config/plugins/visualizations/charts/static/app.js +++ b/config/plugins/visualizations/charts/static/app.js @@ -51,7 +51,6 @@ // append views this.$el.append(this.viewer_view.$el); this.$el.append(this.editor_view.$el); - this.$el.css('height', 'inherit');
// pick start screen if (!this.storage.load()) {
diff -r a146d1007651d7f08240d39f0ac18a2491207bc7 -r b3b39af86c36a4f141bbe64dfec4ad59f3facbe7 config/plugins/visualizations/charts/static/charts/nvd3/config.js --- a/config/plugins/visualizations/charts/static/charts/nvd3/config.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3/config.js @@ -1,15 +1,15 @@ define([], function() {
return { - title : '', - library : 'nvd3.js', - element : 'svg', + title : '', + library : 'nvd3.js', + element : 'svg', columns : { y : { title : 'Values for y-axis' } }, - settings : { + settings : { separator_label : { title : 'X axis', type : 'separator'
diff -r a146d1007651d7f08240d39f0ac18a2491207bc7 -r b3b39af86c36a4f141bbe64dfec4ad59f3facbe7 config/plugins/visualizations/charts/static/charts/nvd3_piechart/config.js --- a/config/plugins/visualizations/charts/static/charts/nvd3_piechart/config.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3_piechart/config.js @@ -1,7 +1,18 @@ -define(['plugin/charts/nvd3/config'], function(nvd3_config) { +define([], function() {
-return $.extend(true, {}, nvd3_config, { - title : 'Pie chart', -}); +return { + title : 'Pie chart', + library : 'nvd3.js', + element : 'svg', + columns : { + label : { + title : 'Labels', + any_type : true + }, + y : { + title : 'Values' + } + } +};
}); \ No newline at end of file
diff -r a146d1007651d7f08240d39f0ac18a2491207bc7 -r b3b39af86c36a4f141bbe64dfec4ad59f3facbe7 config/plugins/visualizations/charts/static/charts/nvd3_piechart/nvd3_piechart.js --- a/config/plugins/visualizations/charts/static/charts/nvd3_piechart/nvd3_piechart.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3_piechart/nvd3_piechart.js @@ -27,29 +27,29 @@ for (var key in group.values) { var value = group.values[key]; pie_data.push ({ - key : value.x, - y : value.y + y : value.y, + x : value.label }); } + } + + // add graph to screen + nv.addGraph(function() { + self.chart_3d = nv.models.pieChart() + .donut(true) + .showLegend(false);
- // add graph to screen - nv.addGraph(function() { - self.chart_3d = nv.models.pieChart() - .donut(true) - .showLegend(false); - - self.options.canvas.datum(pie_data) - .call(self.chart_3d); + self.options.canvas.datum(pie_data) + .call(self.chart_3d);
- nv.utils.windowResize(self.chart_3d.update); - - // set chart state - chart.state('ok', 'Pie chart drawn.'); - - // unregister process - chart.deferred.done(process_id); - }); - } + nv.utils.windowResize(self.chart_3d.update); + + // set chart state + chart.state('ok', 'Chart has been drawn.'); + + // unregister process + chart.deferred.done(process_id); + }); }); } });
diff -r a146d1007651d7f08240d39f0ac18a2491207bc7 -r b3b39af86c36a4f141bbe64dfec4ad59f3facbe7 config/plugins/visualizations/charts/static/library/deferred.js --- a/config/plugins/visualizations/charts/static/library/deferred.js +++ b/config/plugins/visualizations/charts/static/library/deferred.js @@ -59,17 +59,19 @@
// unregister process done: function(id) { - // delete tag - delete this.process[id]; - - // decrease process counter - this.counter--; - - // log - console.debug('Deferred:done() - Unregistering ' + id); - - // trigger change - this.trigger('refresh'); + if (this.process[id]) { + // delete tag + delete this.process[id]; + + // decrease process counter + this.counter--; + + // log + console.debug('Deferred:done() - Unregistering ' + id); + + // trigger change + this.trigger('refresh'); + } },
// ready
diff -r a146d1007651d7f08240d39f0ac18a2491207bc7 -r b3b39af86c36a4f141bbe64dfec4ad59f3facbe7 config/plugins/visualizations/charts/static/views/group.js --- a/config/plugins/visualizations/charts/static/views/group.js +++ b/config/plugins/visualizations/charts/static/views/group.js @@ -5,9 +5,6 @@ // widget return Backbone.View.extend( { - // columns - columns: [], - // initialize initialize: function(app, options) { // link app @@ -121,24 +118,29 @@
// get dataset this.app.datasets.request({id : dataset_id}, function(dataset) { - // configure columns - self.columns = []; - var meta = dataset.metadata_column_types; - for (var key in meta) { - // check type - if(meta[key] == 'int' || meta[key] == 'float') { - // add to selection - self.columns.push({ - 'label' : 'Column: ' + (parseInt(key) + 1) + ' [' + meta[key] + ']', - 'value' : key - }); + // update select fields + for (var id in list) { + + // is a numeric number required + var any_type = chart_settings.columns[id].any_type; + + // configure columns + var columns = []; + var meta = dataset.metadata_column_types; + for (var key in meta) { + // check type + if (meta[key] == 'int' || meta[key] == 'float' || any_type) { + // add to selection + columns.push({ + 'label' : 'Column: ' + (parseInt(key) + 1) + ' [' + meta[key] + ']', + 'value' : key + }); + } } - }
- // update select fields - for (var key in list) { - list[key].update(self.columns); - list[key].show(); + // list + list[id].update(columns); + list[id].show(); }
// loading
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.
galaxy-commits@lists.galaxyproject.org