commit/galaxy-central: guerler: Charts: Improve histogram module
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/934681daa52e/ Changeset: 934681daa52e User: guerler Date: 2014-04-18 00:03:54 Summary: Charts: Improve histogram module Affected #: 1 file diff -r 8f940d25dc283ed462ab8df3873d235789cabe38 -r 934681daa52e477e60bc4e99fbcc154a537dd3b3 config/plugins/visualizations/charts/static/charts/nvd3_histogram/nvd3_histogram.js --- a/config/plugins/visualizations/charts/static/charts/nvd3_histogram/nvd3_histogram.js +++ b/config/plugins/visualizations/charts/static/charts/nvd3_histogram/nvd3_histogram.js @@ -14,12 +14,12 @@ draw : function(process_id, chart, request_dictionary) { // configure request - var index = 0; + var index = 1; for (var i in request_dictionary.groups) { var group = request_dictionary.groups[i]; group.columns = { x: { - index: index++ + index: 0 }, y: { index: index++ @@ -32,50 +32,7 @@ // load nvd3 var nvd3 = new NVD3(this.app, this.options); - nvd3.draw(process_id, nv.models.multiBarChart(), chart, request_dictionary, function() { - // ensure data consistency - self._fix_partial_data(request_dictionary.groups); - }); - }, - - // the histogram module might generate partial data i.e. length(col1) = 10, length(col2) = 11, length(col3) = 12. - // this function ensures that data is consistent, such that all columns have the same length. - _fix_partial_data: function(groups) { - // x-values - var x_list = {}; - - // identify all x values - for (var i in groups) { - var x_sub = this._identify_x_values(groups[i].values); - x_list = _.extend(x_list, x_sub); - } - - // identify all x values - for (var i in groups) { - var values = groups[i].values; - var x_sub = this._identify_x_values(values); - for (var x in x_list) { - if (x_sub[x] === undefined) { - values.push({ - x: parseFloat(x), - y: 0.0 - }); - } - } - values.sort(function(a, b) {return a.x - b.x}) - } - }, - - // identify available x-values - _identify_x_values: function(values) { - var x_list = {}; - for (var j in values) { - var x_value = values[j].x; - if (x_value !== undefined && x_value !== null) { - x_list[x_value] = true; - } - } - return x_list; + nvd3.draw(process_id, nv.models.multiBarChart(), chart, request_dictionary); } }); 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