galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
March 2014
- 1 participants
- 170 discussions
commit/galaxy-central: guerler: Charts: Modularize option form fields
by commits-noreply@bitbucket.org 08 Mar '14
by commits-noreply@bitbucket.org 08 Mar '14
08 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a2f88681c8d9/
Changeset: a2f88681c8d9
User: guerler
Date: 2014-03-08 05:53:16
Summary: Charts: Modularize option form fields
Affected #: 2 files
diff -r 7efdd4019ed122743ca920d2d30811737277d6a8 -r a2f88681c8d9a3bf8d5f124be7ddf365c2e33eab config/plugins/visualizations/charts/static/library/ui-table-form.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/library/ui-table-form.js
@@ -0,0 +1,87 @@
+// dependencies
+define(['plugin/library/table', 'plugin/library/ui', 'utils/utils'],
+ function(Table, Ui, Utils) {
+
+// widget
+var View = Backbone.View.extend(
+{
+ // initialize
+ initialize: function(options) {
+ // ui elements
+ this.table = new Table({content: options.content});
+
+ // create element
+ var $view = $('<div/>');
+ $view.append(Utils.wrap((new Ui.Label({title: options.title})).$el));
+ $view.append(Utils.wrap(this.table.$el));
+
+ // add element
+ this.setElement($view);
+ },
+
+ // update
+ update: function(settings, model) {
+ // reset table
+ this.table.removeAll();
+
+ // load settings elements into table
+ for (var id in settings) {
+ this._add(id, settings[id], model);
+ }
+ },
+
+ // add table row
+ _add: function(id, settings_def, model) {
+ // field wrapper
+ var field = null;
+
+ // create select field
+ switch(settings_def.type) {
+ // text input field
+ case 'text' :
+ field = new Ui.Input({
+ placeholder: settings_def.placeholder,
+ onchange: function() {
+ model.set(id, field.value());
+ }
+ });
+ break;
+ // slider input field
+ case 'slider' :
+ field = new Ui.Input({
+ placeholder: settings_def.placeholder,
+ onchange: function() {
+ model.set(id, field.value());
+ }
+ });
+ break;
+ // skip unkown types
+ default:
+ console.log('ui-table-form:_add', 'Unknown setting type (' + settings_def.type + ')');
+ return;
+
+ }
+
+ // set value
+ if (!model.get(id)) {
+ model.set(id, settings_def.init);
+ }
+ field.value(model.get(id));
+
+ // combine field and info
+ var $input = $('<div/>');
+ $input.append(field.$el);
+ $input.append('<div class="toolParamHelp">' + settings_def.info + '</div>');
+
+ // add row to table
+ this.table.add('<span style="white-space: nowrap;">' + settings_def.title + ':</span>');
+ this.table.add($input);
+ this.table.append(id);
+ }
+});
+
+return {
+ View : View
+}
+
+});
\ No newline at end of file
diff -r 7efdd4019ed122743ca920d2d30811737277d6a8 -r a2f88681c8d9a3bf8d5f124be7ddf365c2e33eab config/plugins/visualizations/charts/static/views/settings.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/views/settings.js
@@ -0,0 +1,50 @@
+// dependencies
+define(['plugin/library/ui', 'plugin/library/ui-table-form', 'utils/utils'],
+ function(Ui, TableForm, Utils) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ // link app
+ this.app = app;
+
+ // link this
+ var self = this;
+
+ // get current chart object
+ this.chart = this.app.chart;
+
+ this.form = new TableForm.View({
+ title : 'Chart options:',
+ content : 'This chart type does not provide any options.'
+ });
+
+ // set element
+ this.setElement(this.form.$el);
+
+ // change
+ var self = this;
+ this.chart.on('change', function() {
+ self._refreshTable();
+ });
+ },
+
+ // update dataset
+ _refreshTable: function() {
+ // identify datasets
+ var chart_type = this.chart.get('type');
+
+ // check if dataset is available
+ if (!chart_type) {
+ return;
+ }
+
+ // update table form model
+ var chart_definition = this.app.types.get(chart_type);
+ this.form.update(chart_definition.settings, this.chart.settings);
+ }
+});
+
+});
\ No newline at end of file
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.
1
0
commit/galaxy-central: guerler: Charts: Unify chart options
by commits-noreply@bitbucket.org 07 Mar '14
by commits-noreply@bitbucket.org 07 Mar '14
07 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7efdd4019ed1/
Changeset: 7efdd4019ed1
User: guerler
Date: 2014-03-08 00:48:30
Summary: Charts: Unify chart options
Affected #: 19 files
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/_nvd3/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/_nvd3/config.js
@@ -0,0 +1,28 @@
+define([], function() {
+
+return {
+ title : '',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ },
+ settings : {
+ x_axis_label : {
+ title : 'Axis label (x)',
+ info : 'Provide a label for the \'x\' axis.',
+ type : 'text',
+ init : '',
+ placeholder : 'Axis label'
+ },
+ y_axis_label : {
+ title : 'Axis label (y)',
+ info : 'Provide a label for the \'y\' axis.',
+ type : 'text',
+ init : '',
+ placeholder : 'Axis label'
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/_nvd3/nvd3.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/_nvd3/nvd3.js
@@ -0,0 +1,44 @@
+// dependencies
+define([], function() {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(nvd3_model, chart, request_dictionary, callback)
+ {
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function(data) {
+ nv.addGraph(function() {
+
+ nvd3_model.yAxis.tickFormat(d3.format('.1f'))
+ .axisLabel(chart.settings.get('y_axis_label', 'Frequency'))
+ .axisLabelDistance(30);
+
+ nvd3_model.xAxis.tickFormat(d3.format('.2f'))
+ .axisLabel(chart.settings.get('x_axis_label', 'Breaks'));
+
+ if (callback) {
+ callback(nvd3_model);
+ }
+
+ self.options.svg.datum(data)
+ .call(nvd3_model);
+
+ nv.utils.windowResize(nvd3_model.update);
+
+ // set chart state
+ chart.set('state', 'ok');
+ });
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/bardiagram/bardiagram.js
--- a/config/plugins/visualizations/charts/static/charts/bardiagram/bardiagram.js
+++ b/config/plugins/visualizations/charts/static/charts/bardiagram/bardiagram.js
@@ -1,5 +1,5 @@
// dependencies
-define([], function() {
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
// widget
return Backbone.View.extend(
@@ -13,28 +13,8 @@
// render
draw : function(chart, request_dictionary)
{
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- nv.addGraph(function() {
- self.d3_chart = nv.models.multiBarChart();
-
- self.d3_chart.yAxis.tickFormat(d3.format('.1f'))
- .axisLabel(chart.settings.get('y_axis_label', 'Frequency'))
- .axisLabelDistance(30);
-
- self.d3_chart.xAxis.tickFormat(d3.format('.2f'))
- .axisLabel(chart.settings.get('x_axis_label', 'Breaks'));
-
- self.options.svg.datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
- });
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(nv.models.multiBarChart(), chart, request_dictionary);
}
});
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/bardiagram/config.js
--- a/config/plugins/visualizations/charts/static/charts/bardiagram/config.js
+++ b/config/plugins/visualizations/charts/static/charts/bardiagram/config.js
@@ -1,28 +1,7 @@
-define([], function() {
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
-return {
+return $.extend(true, {}, nvd3_config, {
title : 'Bar diagram',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- },
- settings : {
- x_axis_label : {
- title : 'Axis label (x)',
- info : 'Provide a label for the \'x\' axis.',
- type : 'text',
- init : '',
- placeholder : 'Axis label'
- },
- y_axis_label : {
- title : 'Axis label (y)',
- info : 'Provide a label for the \'y\' axis.',
- type : 'text',
- init : '',
- placeholder : 'Axis label'
- }
- }
-};
+});
});
\ No newline at end of file
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/histogram/config.js
--- a/config/plugins/visualizations/charts/static/charts/histogram/config.js
+++ b/config/plugins/visualizations/charts/static/charts/histogram/config.js
@@ -1,21 +1,14 @@
-define([], function() {
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
-return {
+return $.extend(true, {}, nvd3_config, {
title : 'Histogram',
mode : 'execute',
columns : {
- y : {
- title : 'Derive frequencies'
+ x : {
+ title : 'Values for x-axis'
}
},
settings : {
- x_axis_label : {
- title : 'Axis label (x)',
- info : 'Provide a label for the \'x\' axis.',
- type : 'text',
- init : 'Breaks',
- placeholder : 'Axis label'
- },
bin_size : {
title : 'Number of Bins',
info : 'Provide the number of histogram bins. The parsed data will be evenly distributed into bins according to the minimum and maximum values of the dataset.',
@@ -25,6 +18,6 @@
max : 1000,
}
}
-};
+});
});
\ No newline at end of file
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/histogram/histogram.js
--- a/config/plugins/visualizations/charts/static/charts/histogram/histogram.js
+++ b/config/plugins/visualizations/charts/static/charts/histogram/histogram.js
@@ -1,5 +1,5 @@
// dependencies
-define([], function() {
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
// widget
return Backbone.View.extend(
@@ -9,10 +9,10 @@
this.app = app;
this.options = options;
},
-
- // draw
- draw: function(chart, request_dictionary) {
-
+
+ // render
+ draw : function(chart, request_dictionary)
+ {
// update request dataset id
request_dictionary.id = chart.get('dataset_id_job');
@@ -25,29 +25,11 @@
y: index++
}
}
-
- // send request
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- // set chart state
- chart.set('state', 'ok');
-
- // draw graph
- nv.addGraph(function() {
- self.d3_chart = nv.models.multiBarChart();
-
- self.d3_chart.xAxis.tickFormat(d3.format('.2f'))
- .axisLabel('Breaks');
-
- self.d3_chart.yAxis.tickFormat(d3.format('.3f'))
- .axisLabel('Frequency')
- .axisLabelDistance(30);
-
- self.options.svg.datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
- });
+
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(nv.models.multiBarChart(), chart, request_dictionary, function(nvd3_model) {
+ nvd3_model.xAxis.tickFormat(d3.format('.2f'));
+ nvd3_model.yAxis.tickFormat(d3.format('.3f'));
});
}
});
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/horizontal/config.js
--- a/config/plugins/visualizations/charts/static/charts/horizontal/config.js
+++ b/config/plugins/visualizations/charts/static/charts/horizontal/config.js
@@ -1,12 +1,7 @@
-define([], function() {
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
-return {
+return $.extend(true, {}, nvd3_config, {
title : 'Bar diagram (horizontal)',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
-};
+});
});
\ No newline at end of file
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/horizontal/horizontal.js
--- a/config/plugins/visualizations/charts/static/charts/horizontal/horizontal.js
+++ b/config/plugins/visualizations/charts/static/charts/horizontal/horizontal.js
@@ -1,5 +1,5 @@
// dependencies
-define(['utils/utils'], function(Utils) {
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
// widget
return Backbone.View.extend(
@@ -13,23 +13,9 @@
// render
draw : function(chart, request_dictionary)
{
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- // add graph to screen
- nv.addGraph(function() {
- self.d3_chart = nv.models.multiBarHorizontalChart();
-
- self.d3_chart.xAxis.tickFormat(function() { return ''; });
-
- self.options.svg.datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(nv.models.multiBarHorizontalChart(), chart, request_dictionary, function(nvd3_model) {
+ nvd3_model.xAxis.tickFormat(function() { return ''; });
});
}
});
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/line/config.js
--- a/config/plugins/visualizations/charts/static/charts/line/config.js
+++ b/config/plugins/visualizations/charts/static/charts/line/config.js
@@ -1,12 +1,7 @@
-define([], function() {
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
-return {
+return $.extend(true, {}, nvd3_config, {
title : 'Line chart',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
-};
+});
});
\ No newline at end of file
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/line/line.js
--- a/config/plugins/visualizations/charts/static/charts/line/line.js
+++ b/config/plugins/visualizations/charts/static/charts/line/line.js
@@ -1,5 +1,5 @@
// dependencies
-define(['utils/utils'], function(Utils) {
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
// widget
return Backbone.View.extend(
@@ -13,27 +13,8 @@
// render
draw : function(chart, request_dictionary)
{
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- nv.addGraph(function() {
- self.chart_3d = nv.models.lineChart();
-
- self.chart_3d.xAxis
- .tickFormat(d3.format(',f'));
-
- self.chart_3d.yAxis
- .tickFormat(d3.format(',.2f'));
-
- self.options.svg.datum(data)
- .call(self.chart_3d);
-
- nv.utils.windowResize(self.chart_3d.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
- });
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(nv.models.lineChart(), chart, request_dictionary);
}
});
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/linewithfocus/config.js
--- a/config/plugins/visualizations/charts/static/charts/linewithfocus/config.js
+++ b/config/plugins/visualizations/charts/static/charts/linewithfocus/config.js
@@ -1,12 +1,7 @@
-define([], function() {
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
-return {
- title : 'Line chart (with focus)',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
-};
+return $.extend(true, {}, nvd3_config, {
+ title : 'Line with focus',
+});
});
\ No newline at end of file
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/linewithfocus/linewithfocus.js
--- a/config/plugins/visualizations/charts/static/charts/linewithfocus/linewithfocus.js
+++ b/config/plugins/visualizations/charts/static/charts/linewithfocus/linewithfocus.js
@@ -1,5 +1,5 @@
// dependencies
-define(['utils/utils'], function(Utils) {
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
// widget
return Backbone.View.extend(
@@ -13,27 +13,8 @@
// render
draw : function(chart, request_dictionary)
{
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- nv.addGraph(function() {
- self.chart_3d = nv.models.lineWithFocusChart();
-
- self.chart_3d.xAxis
- .tickFormat(d3.format(',f'));
-
- self.chart_3d.yAxis
- .tickFormat(d3.format(',.2f'));
-
- self.options.svg.datum(data)
- .call(self.chart_3d);
-
- nv.utils.windowResize(self.chart_3d.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
- });
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(nv.models.lineWithFocusChart(), chart, request_dictionary);
}
});
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/piechart/config.js
--- a/config/plugins/visualizations/charts/static/charts/piechart/config.js
+++ b/config/plugins/visualizations/charts/static/charts/piechart/config.js
@@ -1,12 +1,7 @@
-define([], function() {
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
-return {
+return $.extend(true, {}, nvd3_config, {
title : 'Pie chart',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
-};
+});
});
\ No newline at end of file
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/scatterplot/config.js
--- a/config/plugins/visualizations/charts/static/charts/scatterplot/config.js
+++ b/config/plugins/visualizations/charts/static/charts/scatterplot/config.js
@@ -1,15 +1,12 @@
-define([], function() {
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
-return {
+return $.extend(true, {}, nvd3_config, {
title : 'Scatter plot',
columns : {
x : {
title : 'Values for x-axis'
- },
- y : {
- title : 'Values for y-axis'
}
}
-};
+});
});
\ No newline at end of file
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/scatterplot/scatterplot.js
--- a/config/plugins/visualizations/charts/static/charts/scatterplot/scatterplot.js
+++ b/config/plugins/visualizations/charts/static/charts/scatterplot/scatterplot.js
@@ -1,5 +1,5 @@
// dependencies
-define(['utils/utils'], function(Utils) {
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
// widget
return Backbone.View.extend(
@@ -13,26 +13,14 @@
// render
draw : function(chart, request_dictionary)
{
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- nv.addGraph(function() {
- self.d3_chart = nv.models.scatterChart()
- .showDistX(true)
- .showDistY(true)
- .color(d3.scale.category10().range());
-
- self.d3_chart.xAxis.tickFormat(d3.format('.02f'))
- self.d3_chart.yAxis.tickFormat(d3.format('.02f'))
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(nv.models.scatterChart(), chart, request_dictionary, function(nvd3_model) {
+ nvd3_model.showDistX(true)
+ .showDistY(true)
+ .color(d3.scale.category10().range());
+ nvd3_model.xAxis.tickFormat(d3.format('.02f'));
+ nvd3_model.yAxis.tickFormat(d3.format('.02f'));
- self.options.svg.datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
});
}
});
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/stackedarea/config.js
--- a/config/plugins/visualizations/charts/static/charts/stackedarea/config.js
+++ b/config/plugins/visualizations/charts/static/charts/stackedarea/config.js
@@ -1,12 +1,7 @@
-define([], function() {
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
-return {
+return $.extend(true, {}, nvd3_config, {
title : 'Stacked area',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
-};
+});
});
\ No newline at end of file
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/charts/stackedarea/stackedarea.js
--- a/config/plugins/visualizations/charts/static/charts/stackedarea/stackedarea.js
+++ b/config/plugins/visualizations/charts/static/charts/stackedarea/stackedarea.js
@@ -1,5 +1,5 @@
// dependencies
-define(['utils/utils'], function(Utils) {
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
// widget
return Backbone.View.extend(
@@ -13,30 +13,13 @@
// render
draw : function(chart, request_dictionary)
{
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- nv.addGraph(function() {
- // make plot
- self.d3_chart = nv.models.stackedAreaChart()
- .x(function(d) {
- return d.x
- })
- .y(function(d) {
- return d.y
- })
- .clipEdge(true);
-
- self.d3_chart.xAxis.tickFormat(function() { return ''; });
-
- self.options.svg.datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(nv.models.stackedAreaChart(), chart, request_dictionary, function(nvd3_model) {
+ // make plot
+ nvd3_model.x(function(d) { return d.x })
+ .y(function(d) { return d.y })
+ .clipEdge(true);
+ nvd3_model.xAxis.tickFormat(function() { return ''; });
});
}
});
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 config/plugins/visualizations/charts/static/library/utils.js
--- a/config/plugins/visualizations/charts/static/library/utils.js
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
- * Galaxy utilities comprises small functions, which at this point
- * do not require their own classes/files
-*/
-
-// dependencies
-define(["libs/underscore"], function(_) {
-
-// generic function to recieve json from url
-function get (url, success, error) {
- request('GET', url, {}, success, error);
-};
-
-// generic function to send json to url
-function request (method, url, data, success, error) {
-
- // encode data into url
- if (method == 'GET' || method == 'DELETE') {
- if (url.indexOf('?') == -1) {
- url += '?';
- } else {
- url += '&';
- }
- url += $.param(data)
- }
-
- // prepare request
- var xhr = new XMLHttpRequest();
- xhr.open(method, url, true);
- xhr.setRequestHeader('Accept', 'application/json');
- xhr.setRequestHeader('Cache-Control', 'no-cache');
- xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
- xhr.setRequestHeader('Content-Type', 'application/json');
- xhr.onloadend = function() {
- var status = xhr.status;
- if (status == 200) {
- try {
- response = jQuery.parseJSON(xhr.responseText);
- } catch (e) {
- response = xhr.responseText;
- }
- success && success(response);
- } else {
- error && error(status);
- }
- };
-
- // make request
- if (method == 'GET' || method == 'DELETE') {
- xhr.send();
- } else {
- xhr.send(JSON.stringify(data));
- }
-};
-
-// get css value
-function cssGetAttribute (classname, name) {
- // place dummy element
- var el = $('<div class="' + classname + '"></div>');
-
- // required append
- el.appendTo(':eq(0)');
-
- // get value
- var value = el.css(name);
-
- // remove element
- el.remove();
-
- // return css value
- return value;
-};
-
-// load css
-function cssLoadFile (url) {
- // check if css is already available
- if (!$('link[href^="' + url + '"]').length)
- $('<link href="' + galaxy_config.root + url + '" rel="stylesheet">').appendTo('head');
-};
-
-// merge
-function merge (options, optionsDefault) {
- if (options)
- return _.defaults(options, optionsDefault);
- else
- return optionsDefault;
-};
-
-// to string
-function bytesToString (size, normal_font) {
- // identify unit
- var unit = "";
- if (size >= 100000000000) { size = size / 100000000000; unit = 'TB'; } else
- if (size >= 100000000) { size = size / 100000000; unit = 'GB'; } else
- if (size >= 100000) { size = size / 100000; unit = 'MB'; } else
- if (size >= 100) { size = size / 100; unit = 'KB'; } else
- if (size > 0) { size = size * 10; unit = 'b'; } else
- return '<strong>-</strong>';
-
- // return formatted string
- var rounded = (Math.round(size) / 10);
- if (normal_font) {
- return rounded + ' ' + unit;
- } else {
- return '<strong>' + rounded + '</strong> ' + unit;
- }
-};
-
-// unique ide
-function uuid(){
- return (new Date().getTime()).toString(36);
-};
-
-// wrap
-function wrap($el) {
- var wrapper = $('<p></p>');
- wrapper.append($el);
- return wrapper;
-};
-
-// time
-function time() {
- // get date object
- var d = new Date();
-
- // format items
- var hours = (d.getHours() < 10 ? "0" : "") + d.getHours();
- var minutes = (d.getMinutes() < 10 ? "0" : "") + d.getMinutes()
-
- // format final stamp
- var datetime = d.getDate() + "/"
- + (d.getMonth() + 1) + "/"
- + d.getFullYear() + ", "
- + hours + ":"
- + minutes;
- return datetime;
-};
-
-// return
-return {
- cssLoadFile : cssLoadFile,
- cssGetAttribute : cssGetAttribute,
- get : get,
- merge : merge,
- bytesToString: bytesToString,
- uuid: uuid,
- time: time,
- wrap: wrap,
- request: request
-};
-
-});
diff -r 8ffa9ee618649b042292610cf8d10cff161c5235 -r 7efdd4019ed122743ca920d2d30811737277d6a8 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
@@ -2,7 +2,7 @@
define(['plugin/library/table', 'plugin/library/ui', 'utils/utils'],
function(Table, Ui, Utils) {
-// chart config
+// widget
return Backbone.View.extend(
{
// columns
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.
1
0
commit/galaxy-central: guerler: Charts: Add basic customization capabilities, modularize chart types
by commits-noreply@bitbucket.org 07 Mar '14
by commits-noreply@bitbucket.org 07 Mar '14
07 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8ffa9ee61864/
Changeset: 8ffa9ee61864
User: guerler
Date: 2014-03-07 23:01:39
Summary: Charts: Add basic customization capabilities, modularize chart types
Affected #: 32 files
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/app.js
--- a/config/plugins/visualizations/charts/static/app.js
+++ b/config/plugins/visualizations/charts/static/app.js
@@ -1,7 +1,7 @@
// dependencies
define(['mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'plugin/library/ui', 'utils/utils', 'plugin/library/jobs', 'plugin/library/datasets',
'plugin/views/charts', 'plugin/views/chart',
- 'plugin/models/config', 'plugin/models/chart', 'plugin/models/charts', 'plugin/models/types'],
+ 'plugin/models/config', 'plugin/models/chart', 'plugin/models/charts', 'plugin/charts/types'],
function( Modal, Portlet, Ui, Utils, Jobs, Datasets,
ChartsView, ChartView,
Config, Chart, Charts, Types
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/bardiagram.js
--- a/config/plugins/visualizations/charts/static/charts/bardiagram.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// dependencies
-define([], function() {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- },
-
- // render
- plot : function(chart, request_dictionary)
- {
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- nv.addGraph(function() {
- self.d3_chart = nv.models.multiBarChart();
-
- self.d3_chart.xAxis.tickFormat(d3.format('.2f'))
- self.d3_chart.yAxis.tickFormat(d3.format('.1f'))
-
- self.options.svg.datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
- });
- }
-});
-
-});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/bardiagram/bardiagram.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/bardiagram/bardiagram.js
@@ -0,0 +1,41 @@
+// dependencies
+define([], function() {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(chart, request_dictionary)
+ {
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function(data) {
+ nv.addGraph(function() {
+ self.d3_chart = nv.models.multiBarChart();
+
+ self.d3_chart.yAxis.tickFormat(d3.format('.1f'))
+ .axisLabel(chart.settings.get('y_axis_label', 'Frequency'))
+ .axisLabelDistance(30);
+
+ self.d3_chart.xAxis.tickFormat(d3.format('.2f'))
+ .axisLabel(chart.settings.get('x_axis_label', 'Breaks'));
+
+ self.options.svg.datum(data)
+ .call(self.d3_chart);
+
+ nv.utils.windowResize(self.d3_chart.update);
+
+ // set chart state
+ chart.set('state', 'ok');
+ });
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/bardiagram/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/bardiagram/config.js
@@ -0,0 +1,28 @@
+define([], function() {
+
+return {
+ title : 'Bar diagram',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ },
+ settings : {
+ x_axis_label : {
+ title : 'Axis label (x)',
+ info : 'Provide a label for the \'x\' axis.',
+ type : 'text',
+ init : '',
+ placeholder : 'Axis label'
+ },
+ y_axis_label : {
+ title : 'Axis label (y)',
+ info : 'Provide a label for the \'y\' axis.',
+ type : 'text',
+ init : '',
+ placeholder : 'Axis label'
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/histogram.js
--- a/config/plugins/visualizations/charts/static/charts/histogram.js
+++ /dev/null
@@ -1,52 +0,0 @@
-// dependencies
-define([], function() {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- },
-
- // plot
- plot: function(chart, request_dictionary) {
-
- // update request dataset id
- request_dictionary.id = chart.get('dataset_id_job');
-
- // configure request
- var index = 0;
- for (var i in request_dictionary.groups) {
- var group = request_dictionary.groups[i];
- group.columns = {
- x: index++,
- y: index++
- }
- }
-
- // send request
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- chart.set('state', 'ok');
- nv.addGraph(function() {
- self.d3_chart = nv.models.multiBarChart();
-
- self.d3_chart.xAxis.tickFormat(d3.format('.2f'))
- .axisLabel('Breaks');
-
- self.d3_chart.yAxis.tickFormat(d3.format('.3f'))
- .axisLabel('Frequency')
- .axisLabelDistance(30);
-
- self.options.svg.datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
- });
- });
- }
-});
-
-});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/histogram/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/histogram/config.js
@@ -0,0 +1,30 @@
+define([], function() {
+
+return {
+ title : 'Histogram',
+ mode : 'execute',
+ columns : {
+ y : {
+ title : 'Derive frequencies'
+ }
+ },
+ settings : {
+ x_axis_label : {
+ title : 'Axis label (x)',
+ info : 'Provide a label for the \'x\' axis.',
+ type : 'text',
+ init : 'Breaks',
+ placeholder : 'Axis label'
+ },
+ bin_size : {
+ title : 'Number of Bins',
+ info : 'Provide the number of histogram bins. The parsed data will be evenly distributed into bins according to the minimum and maximum values of the dataset.',
+ type : 'slider',
+ init : 10,
+ min : 10,
+ max : 1000,
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/histogram/histogram.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/histogram/histogram.js
@@ -0,0 +1,55 @@
+// dependencies
+define([], function() {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // draw
+ draw: function(chart, request_dictionary) {
+
+ // update request dataset id
+ request_dictionary.id = chart.get('dataset_id_job');
+
+ // configure request
+ var index = 0;
+ for (var i in request_dictionary.groups) {
+ var group = request_dictionary.groups[i];
+ group.columns = {
+ x: index++,
+ y: index++
+ }
+ }
+
+ // send request
+ var self = this;
+ this.app.datasets.request(request_dictionary, function(data) {
+ // set chart state
+ chart.set('state', 'ok');
+
+ // draw graph
+ nv.addGraph(function() {
+ self.d3_chart = nv.models.multiBarChart();
+
+ self.d3_chart.xAxis.tickFormat(d3.format('.2f'))
+ .axisLabel('Breaks');
+
+ self.d3_chart.yAxis.tickFormat(d3.format('.3f'))
+ .axisLabel('Frequency')
+ .axisLabelDistance(30);
+
+ self.options.svg.datum(data)
+ .call(self.d3_chart);
+
+ nv.utils.windowResize(self.d3_chart.update);
+ });
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/horizontal.js
--- a/config/plugins/visualizations/charts/static/charts/horizontal.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// dependencies
-define(['utils/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- },
-
- // render
- plot : function(chart, request_dictionary)
- {
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- // add graph to screen
- nv.addGraph(function() {
- self.d3_chart = nv.models.multiBarHorizontalChart();
-
- self.d3_chart.xAxis.tickFormat(function() { return ''; });
-
- self.options.svg.datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
- });
- }
-});
-
-});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/horizontal/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/horizontal/config.js
@@ -0,0 +1,12 @@
+define([], function() {
+
+return {
+ title : 'Bar diagram (horizontal)',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/horizontal/horizontal.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/horizontal/horizontal.js
@@ -0,0 +1,37 @@
+// dependencies
+define(['utils/utils'], function(Utils) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(chart, request_dictionary)
+ {
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function(data) {
+ // add graph to screen
+ nv.addGraph(function() {
+ self.d3_chart = nv.models.multiBarHorizontalChart();
+
+ self.d3_chart.xAxis.tickFormat(function() { return ''; });
+
+ self.options.svg.datum(data)
+ .call(self.d3_chart);
+
+ nv.utils.windowResize(self.d3_chart.update);
+
+ // set chart state
+ chart.set('state', 'ok');
+ });
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/line.js
--- a/config/plugins/visualizations/charts/static/charts/line.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// dependencies
-define(['utils/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- },
-
- // render
- plot : function(chart, request_dictionary)
- {
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- nv.addGraph(function() {
- self.chart_3d = nv.models.lineChart();
-
- self.chart_3d.xAxis
- .tickFormat(d3.format(',f'));
-
- self.chart_3d.yAxis
- .tickFormat(d3.format(',.2f'));
-
- self.options.svg.datum(data)
- .call(self.chart_3d);
-
- nv.utils.windowResize(self.chart_3d.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
- });
- }
-});
-
-});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/line/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/line/config.js
@@ -0,0 +1,12 @@
+define([], function() {
+
+return {
+ title : 'Line chart',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/line/line.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/line/line.js
@@ -0,0 +1,40 @@
+// dependencies
+define(['utils/utils'], function(Utils) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(chart, request_dictionary)
+ {
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function(data) {
+ nv.addGraph(function() {
+ self.chart_3d = nv.models.lineChart();
+
+ self.chart_3d.xAxis
+ .tickFormat(d3.format(',f'));
+
+ self.chart_3d.yAxis
+ .tickFormat(d3.format(',.2f'));
+
+ self.options.svg.datum(data)
+ .call(self.chart_3d);
+
+ nv.utils.windowResize(self.chart_3d.update);
+
+ // set chart state
+ chart.set('state', 'ok');
+ });
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/linewithfocus.js
--- a/config/plugins/visualizations/charts/static/charts/linewithfocus.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// dependencies
-define(['utils/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- },
-
- // render
- plot : function(chart, request_dictionary)
- {
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- nv.addGraph(function() {
- self.chart_3d = nv.models.lineWithFocusChart();
-
- self.chart_3d.xAxis
- .tickFormat(d3.format(',f'));
-
- self.chart_3d.yAxis
- .tickFormat(d3.format(',.2f'));
-
- self.options.svg.datum(data)
- .call(self.chart_3d);
-
- nv.utils.windowResize(self.chart_3d.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
- });
- }
-});
-
-});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/linewithfocus/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/linewithfocus/config.js
@@ -0,0 +1,12 @@
+define([], function() {
+
+return {
+ title : 'Line chart (with focus)',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/linewithfocus/linewithfocus.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/linewithfocus/linewithfocus.js
@@ -0,0 +1,40 @@
+// dependencies
+define(['utils/utils'], function(Utils) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(chart, request_dictionary)
+ {
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function(data) {
+ nv.addGraph(function() {
+ self.chart_3d = nv.models.lineWithFocusChart();
+
+ self.chart_3d.xAxis
+ .tickFormat(d3.format(',f'));
+
+ self.chart_3d.yAxis
+ .tickFormat(d3.format(',.2f'));
+
+ self.options.svg.datum(data)
+ .call(self.chart_3d);
+
+ nv.utils.windowResize(self.chart_3d.update);
+
+ // set chart state
+ chart.set('state', 'ok');
+ });
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/piechart.js
--- a/config/plugins/visualizations/charts/static/charts/piechart.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// dependencies
-define(['utils/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- },
-
- // render
- plot : function(chart, request_dictionary)
- {
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
-
- // loop through data groups
- for (var key in request_dictionary.groups) {
- // get group
- var group = request_dictionary.groups[key];
-
- // format chart data
- var pie_data = [];
- for (var key in group.values) {
- var value = group.values[key];
- pie_data.push ({
- key : value.x,
- y : value.y
- });
- }
-
- // add graph to screen
- nv.addGraph(function() {
- self.chart_3d = nv.models.pieChart()
- .donut(true)
- .showLegend(false);
-
- self.options.svg.datum(pie_data)
- .call(self.chart_3d);
-
- nv.utils.windowResize(self.chart_3d.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
- }
- });
- }
-});
-
-});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/piechart/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/piechart/config.js
@@ -0,0 +1,12 @@
+define([], function() {
+
+return {
+ title : 'Pie chart',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/piechart/piechart.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/piechart/piechart.js
@@ -0,0 +1,54 @@
+// dependencies
+define(['utils/utils'], function(Utils) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(chart, request_dictionary)
+ {
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function(data) {
+
+ // loop through data groups
+ for (var key in request_dictionary.groups) {
+ // get group
+ var group = request_dictionary.groups[key];
+
+ // format chart data
+ var pie_data = [];
+ for (var key in group.values) {
+ var value = group.values[key];
+ pie_data.push ({
+ key : value.x,
+ y : value.y
+ });
+ }
+
+ // add graph to screen
+ nv.addGraph(function() {
+ self.chart_3d = nv.models.pieChart()
+ .donut(true)
+ .showLegend(false);
+
+ self.options.svg.datum(pie_data)
+ .call(self.chart_3d);
+
+ nv.utils.windowResize(self.chart_3d.update);
+
+ // set chart state
+ chart.set('state', 'ok');
+ });
+ }
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/scatterplot.js
--- a/config/plugins/visualizations/charts/static/charts/scatterplot.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// dependencies
-define(['utils/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- },
-
- // render
- plot : function(chart, request_dictionary)
- {
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- nv.addGraph(function() {
- self.d3_chart = nv.models.scatterChart()
- .showDistX(true)
- .showDistY(true)
- .color(d3.scale.category10().range());
-
- self.d3_chart.xAxis.tickFormat(d3.format('.02f'))
- self.d3_chart.yAxis.tickFormat(d3.format('.02f'))
-
- self.options.svg.datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
- });
- }
-});
-
-});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/scatterplot/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/scatterplot/config.js
@@ -0,0 +1,15 @@
+define([], function() {
+
+return {
+ title : 'Scatter plot',
+ columns : {
+ x : {
+ title : 'Values for x-axis'
+ },
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/scatterplot/scatterplot.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/scatterplot/scatterplot.js
@@ -0,0 +1,40 @@
+// dependencies
+define(['utils/utils'], function(Utils) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(chart, request_dictionary)
+ {
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function(data) {
+ nv.addGraph(function() {
+ self.d3_chart = nv.models.scatterChart()
+ .showDistX(true)
+ .showDistY(true)
+ .color(d3.scale.category10().range());
+
+ self.d3_chart.xAxis.tickFormat(d3.format('.02f'))
+ self.d3_chart.yAxis.tickFormat(d3.format('.02f'))
+
+ self.options.svg.datum(data)
+ .call(self.d3_chart);
+
+ nv.utils.windowResize(self.d3_chart.update);
+
+ // set chart state
+ chart.set('state', 'ok');
+ });
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/stackedarea.js
--- a/config/plugins/visualizations/charts/static/charts/stackedarea.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// dependencies
-define(['utils/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- },
-
- // render
- plot : function(chart, request_dictionary)
- {
- // request data
- var self = this;
- this.app.datasets.request(request_dictionary, function(data) {
- nv.addGraph(function() {
- // make plot
- self.d3_chart = nv.models.stackedAreaChart()
- .x(function(d) {
- return d.x
- })
- .y(function(d) {
- return d.y
- })
- .clipEdge(true);
-
- self.d3_chart.xAxis.tickFormat(function() { return ''; });
-
- self.options.svg.datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
-
- // set chart state
- chart.set('state', 'ok');
- });
- });
- }
-});
-
-});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/stackedarea/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/stackedarea/config.js
@@ -0,0 +1,12 @@
+define([], function() {
+
+return {
+ title : 'Stacked area',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/stackedarea/stackedarea.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/stackedarea/stackedarea.js
@@ -0,0 +1,44 @@
+// dependencies
+define(['utils/utils'], function(Utils) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(chart, request_dictionary)
+ {
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function(data) {
+ nv.addGraph(function() {
+ // make plot
+ self.d3_chart = nv.models.stackedAreaChart()
+ .x(function(d) {
+ return d.x
+ })
+ .y(function(d) {
+ return d.y
+ })
+ .clipEdge(true);
+
+ self.d3_chart.xAxis.tickFormat(function() { return ''; });
+
+ self.options.svg.datum(data)
+ .call(self.d3_chart);
+
+ nv.utils.windowResize(self.d3_chart.update);
+
+ // set chart state
+ chart.set('state', 'ok');
+ });
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/charts/types.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/types.js
@@ -0,0 +1,36 @@
+// dependencies
+define(['plugin/charts/bardiagram/config',
+ 'plugin/charts/histogram/config',
+ 'plugin/charts/horizontal/config',
+ 'plugin/charts/line/config',
+ 'plugin/charts/linewithfocus/config',
+ 'plugin/charts/piechart/config',
+ 'plugin/charts/scatterplot/config',
+ 'plugin/charts/stackedarea/config',
+ ], function(bardiagram,
+ histogram,
+ horizontal,
+ line,
+ linewithfocus,
+ piechart,
+ scatterplot,
+ stackedarea
+ ) {
+
+// widget
+return Backbone.Model.extend(
+{
+ // types
+ defaults: {
+ 'bardiagram' : bardiagram,
+ 'horizontal' : horizontal,
+ 'histogram' : histogram,
+ 'line' : line,
+ 'linewithfocus' : linewithfocus,
+ 'piechart' : piechart,
+ 'scatterplot' : scatterplot,
+ 'stackedarea' : stackedarea
+ }
+});
+
+});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/library/ui.js
--- a/config/plugins/visualizations/charts/static/library/ui.js
+++ b/config/plugins/visualizations/charts/static/library/ui.js
@@ -69,6 +69,35 @@
});
// plugin
+var Icon = Backbone.View.extend(
+{
+ // options
+ optionsDefault: {
+ float : 'right',
+ icon : '',
+ tooltip : '',
+ placement : 'bottom'
+ },
+
+ // initialize
+ initialize : function(options) {
+ // get options
+ this.options = Utils.merge(options, this.optionsDefault);
+
+ // create new element
+ this.setElement(this._template(this.options));
+
+ // add tooltip
+ $(this.el).tooltip({title: options.tooltip, placement: 'bottom'});
+ },
+
+ // element
+ _template: function(options) {
+ return '<span class="fa ' + options.icon + '" style="font-size: 1.2em;"/>';
+ }
+});
+
+// plugin
var ButtonIcon = Backbone.View.extend(
{
// options
@@ -481,6 +510,7 @@
return {
Label : Label,
Button : Button,
+ Icon : Icon,
ButtonIcon : ButtonIcon,
Input : Input,
Anchor : Anchor,
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/models/chart.js
--- a/config/plugins/visualizations/charts/static/models/chart.js
+++ b/config/plugins/visualizations/charts/static/models/chart.js
@@ -19,6 +19,7 @@
initialize: function(options)
{
this.groups = new Groups();
+ this.settings = new Backbone.Model();
},
// reset
@@ -26,6 +27,7 @@
{
this.clear({silent: true}).set(this.defaults);
this.groups.reset();
+ this.settings.clear();
this.trigger('reset', this);
},
@@ -33,11 +35,19 @@
copy: function(new_chart) {
// copy chart/groups
var current = this;
+
+ // set attributes
+ current.clear({silent: true}).set(this.defaults);
current.set(new_chart.attributes);
+
+ // set nested models/collections
+ current.settings = new_chart.settings.clone();
current.groups.reset();
new_chart.groups.each(function(group) {
current.groups.add(group.clone());
});
+
+ // trigger change
current.trigger('change', current);
},
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/models/types.js
--- a/config/plugins/visualizations/charts/static/models/types.js
+++ /dev/null
@@ -1,80 +0,0 @@
-// dependencies
-define([], function() {
-
-// widget
-return Backbone.Model.extend(
-{
- // types
- defaults: {
- 'bardiagram' : {
- title : 'Bar diagram',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
- },
- 'horizontal' : {
- title : 'Bar diagram (horizontal)',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
- },
- 'histogram' : {
- title : 'Histogram',
- mode : 'execute',
- columns : {
- y : {
- title : 'Derive frequencies'
- }
- }
- },
- 'line' : {
- title : 'Line chart',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
- },
- 'linewithfocus' : {
- title : 'Line chart (with focus)',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
- },
- 'piechart' : {
- title : 'Pie chart',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
- },
- 'scatterplot' : {
- title : 'Scatter plot',
- columns : {
- x : {
- title : 'Values for x-axis'
- },
- y : {
- title : 'Values for y-axis'
- }
- }
- },
- 'stackedarea' : {
- title : 'Stacked area',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
- }
- }
-});
-
-});
\ No newline at end of file
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/views/chart.js
--- a/config/plugins/visualizations/charts/static/views/chart.js
+++ b/config/plugins/visualizations/charts/static/views/chart.js
@@ -1,6 +1,8 @@
// dependencies
-define(['mvc/ui/ui-tabs', 'plugin/library/table', 'plugin/library/ui', 'utils/utils', 'plugin/models/chart', 'plugin/models/group', 'plugin/views/group'],
- function(Tabs, Table, Ui, Utils, Chart, Group, GroupView) {
+define(['mvc/ui/ui-tabs', 'plugin/library/table', 'plugin/library/ui', 'utils/utils',
+ 'plugin/models/chart', 'plugin/models/group',
+ 'plugin/views/group', 'plugin/views/settings'],
+ function(Tabs, Table, Ui, Utils, Chart, Group, GroupView, SettingsView) {
// widget
return Backbone.View.extend(
@@ -33,8 +35,8 @@
if (self.chart.groups.length > 0) {
// show modal
self.app.modal.show({
- title : 'Switching the chart type?',
- body : 'If you continue your data selections will cleared.',
+ title : 'Switching to another chart type?',
+ body : 'If you continue your settings and selections will be reseted.',
buttons : {
'Cancel' : function() {
// hide modal
@@ -55,11 +57,12 @@
}
},
onchange : function(type) {
+ // reset type relevant chart content
+ self.chart.groups.reset();
+ self.chart.settings.clear();
+
// update chart type
self.chart.set({type: type});
-
- // reset groups
- self.chart.groups.reset();
},
content: 'No chart types available'
});
@@ -127,17 +130,31 @@
});
// append element
- var $settings = $('<div/>');
- $settings.append(Utils.wrap((new Ui.Label({ title : 'Provide a chart title:'})).$el));
- $settings.append(Utils.wrap(this.title.$el));
- $settings.append(Utils.wrap((new Ui.Label({ title : 'Select a chart type:'})).$el));
- $settings.append(Utils.wrap(this.table.$el));
+ var $main = $('<div/>');
+ $main.append(Utils.wrap((new Ui.Label({ title : 'Provide a chart title:'})).$el));
+ $main.append(Utils.wrap(this.title.$el));
+ $main.append(Utils.wrap((new Ui.Label({ title : 'Select a chart type:'})).$el));
+ $main.append(Utils.wrap(this.table.$el));
+
+ // add tab
+ this.tabs.add({
+ id : 'main',
+ title : 'Start',
+ $el : $main
+ });
+
+ //
+ // main settings tab
+ //
+
+ // create settings view
+ this.settings = new SettingsView(this.app);
// add tab
this.tabs.add({
id : 'settings',
- title : 'Start',
- $el : $settings
+ title : 'Configuration',
+ $el : this.settings.$el
});
// elements
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/views/charts.js
--- a/config/plugins/visualizations/charts/static/views/charts.js
+++ b/config/plugins/visualizations/charts/static/views/charts.js
@@ -156,11 +156,13 @@
// change
_changeChart: function(chart) {
- // add chart
- this._addChart(chart);
+ if (chart.get('type')) {
+ // add chart
+ this._addChart(chart);
- // select available chart
- this.table.value(chart.id);
+ // select available chart
+ this.table.value(chart.id);
+ }
}
});
diff -r feec63e4fc986281fdd3a00478d410bc6280848b -r 8ffa9ee618649b042292610cf8d10cff161c5235 config/plugins/visualizations/charts/static/views/viewport.js
--- a/config/plugins/visualizations/charts/static/views/viewport.js
+++ b/config/plugins/visualizations/charts/static/views/viewport.js
@@ -135,7 +135,7 @@
var id = '#' + chart_id;
// create element
- var $chart_el = $(this._template({id: id, height : this.options.height}));
+ var $chart_el = $(this._template({id: id}));
// add to portlet
this.portlet.append($chart_el);
@@ -194,7 +194,7 @@
// create chart view
var self = this;
- require(['plugin/charts/' + chart_type], function(ChartView) {
+ require(['plugin/charts/' + chart_type + '/' + chart_type], function(ChartView) {
// create chart
var view = new ChartView(self.app, {svg : svg});
@@ -202,10 +202,10 @@
var mode = chart_settings.mode;
if (mode == 'execute') {
self.app.jobs.submit(chart, self._defaultRequestString(chart), function() {
- view.plot(chart, self._defaultRequestDictionary(chart));
+ view.draw(chart, self._defaultRequestDictionary(chart));
});
} else {
- view.plot(chart, self._defaultRequestDictionary(chart));
+ view.draw(chart, self._defaultRequestDictionary(chart));
}
});
},
@@ -229,7 +229,7 @@
'<span id="icon" style="font-size: 1.2em; display: inline-block;"/>' +
'<span id="text" style="position: relative; margin-left: 5px; top: -1px; font-size: 1.0em;"/>' +
'</span>' +
- '<svg style="height: ' + options.height + 'px;"/>' +
+ '<svg style="height: auto;"/>' +
'</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.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/bc16b9140ee9/
Changeset: bc16b9140ee9
User: davebgx
Date: 2014-03-07 16:38:16
Summary: More informative logging when the env.sh file doesn't meet expectations.
Affected #: 1 file
diff -r 880281e5f42210852a87724b01b4b2411e15a405 -r bc16b9140ee9762ebcb6c2fcd1be1bfee268c388 test/tool_shed/functional/test_1420_tool_dependency_environment_inheritance.py
--- a/test/tool_shed/functional/test_1420_tool_dependency_environment_inheritance.py
+++ b/test/tool_shed/functional/test_1420_tool_dependency_environment_inheritance.py
@@ -316,5 +316,7 @@
tool_dependency_version='1.53.0',
repository=package_boost_repository )
rdkit_env_file_contents = file( rdkit_env_sh, 'r' ).read()
- assert numpy_tool_dependency_path in rdkit_env_file_contents, 'Environment file for package_rdkit_2012_12_1420 does not contain numpy path.'
- assert boost_tool_dependency_path in rdkit_env_file_contents, 'Environment file for package_rdkit_2012_12_1420 does not contain boost path.'
+ if numpy_tool_dependency_path not in rdkit_env_file_contents or boost_tool_dependency_path not in rdkit_env_file_contents:
+ message = 'Environment file for package_rdkit_2012_12_1420 does not contain expected path.'
+ message += '\nExpected:\n%s\n%s\nContents:\n%s' % ( numpy_tool_dependency_path, boost_tool_dependency_path, rdkit_env_file_contents )
+ raise AssertionError( message )
https://bitbucket.org/galaxy/galaxy-central/commits/1bbc2b265fba/
Changeset: 1bbc2b265fba
Branch: stable
User: greg
Date: 2014-03-07 16:36:03
Summary: A few enhancements to the very basic tool shed statistics manager.
Affected #: 3 files
diff -r af15bddfe6854f72d828b46490f8b6c3a4f79bfb -r 1bbc2b265fba40a40ebab9cd03d91a3a7e7d2e18 lib/galaxy/webapps/tool_shed/util/shed_statistics.py
--- a/lib/galaxy/webapps/tool_shed/util/shed_statistics.py
+++ b/lib/galaxy/webapps/tool_shed/util/shed_statistics.py
@@ -1,51 +1,60 @@
-from time import strftime, gmtime
+from time import gmtime
+from time import strftime
+
class ShedCounter( object ):
def __init__( self, model ):
# TODO: Enhance the ShedCounter to retrieve information from the db instead of displaying what's currently in memory.
self.model = model
+ self.custom_datatypes = 0
self.generation_time = strftime( "%b %d, %Y", gmtime() )
+ self.deleted_repositories = 0
+ self.deprecated_repositories = 0
+ self.invalid_versions_of_tools = 0
self.repositories = 0
- #self.new_repositories = 0
- self.deleted_repositories = 0
- self.invalid_tools = 0
- self.valid_tools = 0
+ self.total_clones = 0
+ self.valid_versions_of_tools = 0
+ self.unique_owners = 0
+ self.unique_valid_tools = 0
self.workflows = 0
- self.proprietary_datatypes = 0
- self.total_clones = 0
self.generate_statistics()
+
@property
def sa_session( self ):
"""Returns a SQLAlchemy session"""
return self.model.context
+
def generate_statistics( self ):
+ self.custom_datatypes = 0
+ self.deleted_repositories = 0
+ self.deprecated_repositories = 0
+ self.invalid_versions_of_tools = 0
self.repositories = 0
- #self.new_repositories = 0
- self.deleted_repositories = 0
- self.invalid_tools = 0
- self.valid_tools = 0
+ self.total_clones = 0
+ self.unique_owners = 0
+ self.valid_versions_of_tools = 0
+ self.unique_valid_tools = 0
self.workflows = 0
- self.proprietary_datatypes = 0
- self.total_clones = 0
+ unique_user_ids = []
for repository in self.sa_session.query( self.model.Repository ):
self.repositories += 1
self.total_clones += repository.times_downloaded
is_deleted = repository.deleted
- #is_new = repository.is_new
- #if is_deleted and is_new:
if is_deleted:
self.deleted_repositories += 1
- # self.new_repositories += 1
- #elif is_deleted:
- # self.deleted_repositories += 1
- #elif is_new:
- # self.new_repositories += 1
else:
+ if repository.deprecated:
+ self.deprecated_repositories += 1
+ if repository.user_id not in unique_user_ids:
+ self.unique_owners += 1
+ unique_user_ids.append( repository.user_id )
+ processed_datatypes = []
processed_guids = []
processed_invalid_tool_configs = []
processed_relative_workflow_paths = []
- processed_datatypes = []
- # A repository's metadata_revisions are those that ignore the value of the repository_metadata.downloadable column.
+ processed_tool_ids = []
+ # A repository's metadata_revisions are those that ignore the value of the
+ # repository_metadata.downloadable column.
for metadata_revision in repository.metadata_revisions:
metadata = metadata_revision.metadata
if 'tools' in metadata:
@@ -54,13 +63,18 @@
if 'guid' in tool_dict:
guid = tool_dict[ 'guid' ]
if guid not in processed_guids:
- self.valid_tools += 1
+ self.valid_versions_of_tools += 1
processed_guids.append( guid )
+ if 'id' in tool_dict:
+ tool_id = tool_dict[ 'id' ]
+ if tool_id not in processed_tool_ids:
+ self.unique_valid_tools += 1
+ processed_tool_ids.append( tool_id )
if 'invalid_tools' in metadata:
invalid_tool_configs = metadata[ 'invalid_tools' ]
for invalid_tool_config in invalid_tool_configs:
if invalid_tool_config not in processed_invalid_tool_configs:
- self.invalid_tools += 1
+ self.invalid_versions_of_tools += 1
processed_invalid_tool_configs.append( invalid_tool_config )
if 'datatypes' in metadata:
datatypes = metadata[ 'datatypes' ]
@@ -68,7 +82,7 @@
if 'extension' in datatypes_dict:
extension = datatypes_dict[ 'extension' ]
if extension not in processed_datatypes:
- self.proprietary_datatypes += 1
+ self.custom_datatypes += 1
processed_datatypes.append( extension )
if 'workflows' in metadata:
workflows = metadata[ 'workflows' ]
diff -r af15bddfe6854f72d828b46490f8b6c3a4f79bfb -r 1bbc2b265fba40a40ebab9cd03d91a3a7e7d2e18 templates/webapps/tool_shed/admin/statistics.mako
--- a/templates/webapps/tool_shed/admin/statistics.mako
+++ b/templates/webapps/tool_shed/admin/statistics.mako
@@ -18,29 +18,37 @@
<td>Total repositories</td><td>${trans.app.shed_counter.repositories | h}</td></tr>
- ##<tr>
- ## <td>Empty repositories</td>
- ## <td>${trans.app.shed_counter.new_repositories | h}</td>
- ##</tr>
+ <tr>
+ <td>Unique owners</td>
+ <td>${trans.app.shed_counter.unique_owners | h}</td>
+ </tr>
+ <tr>
+ <td>Deprecated repositories</td>
+ <td>${trans.app.shed_counter.deprecated_repositories | h}</td>
+ </tr><tr><td>Deleted repositories</td><td>${trans.app.shed_counter.deleted_repositories | h}</td></tr><tr><td>Valid tools</td>
- <td>${trans.app.shed_counter.valid_tools | h}</td>
+ <td>${trans.app.shed_counter.unique_valid_tools | h}</td></tr><tr>
- <td>Invalid tools</td>
- <td>${trans.app.shed_counter.invalid_tools | h}</td>
+ <td>Valid versions of tools</td>
+ <td>${trans.app.shed_counter.valid_versions_of_tools | h}</td></tr><tr>
- <td>Workflows</td>
+ <td>Invalid versions of tools</td>
+ <td>${trans.app.shed_counter.invalid_versions_of_tools | h}</td>
+ </tr>
+ <tr>
+ <td>Exported Galaxy workflows</td><td>${trans.app.shed_counter.workflows | h}</td></tr><tr>
- <td>Proprietary datatypes</td>
- <td>${trans.app.shed_counter.proprietary_datatypes | h}</td>
+ <td>Custom datatypes</td>
+ <td>${trans.app.shed_counter.custom_datatypes | h}</td></tr><tr><td>Total clones</td>
diff -r af15bddfe6854f72d828b46490f8b6c3a4f79bfb -r 1bbc2b265fba40a40ebab9cd03d91a3a7e7d2e18 templates/webapps/tool_shed/index.mako
--- a/templates/webapps/tool_shed/index.mako
+++ b/templates/webapps/tool_shed/index.mako
@@ -44,7 +44,7 @@
<%def name="left_panel()"><% can_review_repositories = trans.app.security_agent.user_can_review_repositories( trans.user ) %><div class="unified-panel-header" unselectable="on">
- <div class='unified-panel-header-inner'>${trans.app.shed_counter.valid_tools | h} valid tools on ${trans.app.shed_counter.generation_time | h}</div>
+ <div class='unified-panel-header-inner'>${trans.app.shed_counter.unique_valid_tools | h} valid tools on ${trans.app.shed_counter.generation_time | h}</div></div><div class="unified-panel-body"><div class="toolMenu">
https://bitbucket.org/galaxy/galaxy-central/commits/feec63e4fc98/
Changeset: feec63e4fc98
User: davebgx
Date: 2014-03-07 16:39:08
Summary: Merge with stable.
Affected #: 0 files
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.
1
0
commit/galaxy-central: greg: A few enhancements to the very basic tool shed statistics manager.
by commits-noreply@bitbucket.org 07 Mar '14
by commits-noreply@bitbucket.org 07 Mar '14
07 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/880281e5f422/
Changeset: 880281e5f422
User: greg
Date: 2014-03-07 16:36:03
Summary: A few enhancements to the very basic tool shed statistics manager.
Affected #: 3 files
diff -r 9850950581c7792409ceb0fbfea06bac8fcda6f7 -r 880281e5f42210852a87724b01b4b2411e15a405 lib/galaxy/webapps/tool_shed/util/shed_statistics.py
--- a/lib/galaxy/webapps/tool_shed/util/shed_statistics.py
+++ b/lib/galaxy/webapps/tool_shed/util/shed_statistics.py
@@ -1,51 +1,60 @@
-from time import strftime, gmtime
+from time import gmtime
+from time import strftime
+
class ShedCounter( object ):
def __init__( self, model ):
# TODO: Enhance the ShedCounter to retrieve information from the db instead of displaying what's currently in memory.
self.model = model
+ self.custom_datatypes = 0
self.generation_time = strftime( "%b %d, %Y", gmtime() )
+ self.deleted_repositories = 0
+ self.deprecated_repositories = 0
+ self.invalid_versions_of_tools = 0
self.repositories = 0
- #self.new_repositories = 0
- self.deleted_repositories = 0
- self.invalid_tools = 0
- self.valid_tools = 0
+ self.total_clones = 0
+ self.valid_versions_of_tools = 0
+ self.unique_owners = 0
+ self.unique_valid_tools = 0
self.workflows = 0
- self.proprietary_datatypes = 0
- self.total_clones = 0
self.generate_statistics()
+
@property
def sa_session( self ):
"""Returns a SQLAlchemy session"""
return self.model.context
+
def generate_statistics( self ):
+ self.custom_datatypes = 0
+ self.deleted_repositories = 0
+ self.deprecated_repositories = 0
+ self.invalid_versions_of_tools = 0
self.repositories = 0
- #self.new_repositories = 0
- self.deleted_repositories = 0
- self.invalid_tools = 0
- self.valid_tools = 0
+ self.total_clones = 0
+ self.unique_owners = 0
+ self.valid_versions_of_tools = 0
+ self.unique_valid_tools = 0
self.workflows = 0
- self.proprietary_datatypes = 0
- self.total_clones = 0
+ unique_user_ids = []
for repository in self.sa_session.query( self.model.Repository ):
self.repositories += 1
self.total_clones += repository.times_downloaded
is_deleted = repository.deleted
- #is_new = repository.is_new
- #if is_deleted and is_new:
if is_deleted:
self.deleted_repositories += 1
- # self.new_repositories += 1
- #elif is_deleted:
- # self.deleted_repositories += 1
- #elif is_new:
- # self.new_repositories += 1
else:
+ if repository.deprecated:
+ self.deprecated_repositories += 1
+ if repository.user_id not in unique_user_ids:
+ self.unique_owners += 1
+ unique_user_ids.append( repository.user_id )
+ processed_datatypes = []
processed_guids = []
processed_invalid_tool_configs = []
processed_relative_workflow_paths = []
- processed_datatypes = []
- # A repository's metadata_revisions are those that ignore the value of the repository_metadata.downloadable column.
+ processed_tool_ids = []
+ # A repository's metadata_revisions are those that ignore the value of the
+ # repository_metadata.downloadable column.
for metadata_revision in repository.metadata_revisions:
metadata = metadata_revision.metadata
if 'tools' in metadata:
@@ -54,13 +63,18 @@
if 'guid' in tool_dict:
guid = tool_dict[ 'guid' ]
if guid not in processed_guids:
- self.valid_tools += 1
+ self.valid_versions_of_tools += 1
processed_guids.append( guid )
+ if 'id' in tool_dict:
+ tool_id = tool_dict[ 'id' ]
+ if tool_id not in processed_tool_ids:
+ self.unique_valid_tools += 1
+ processed_tool_ids.append( tool_id )
if 'invalid_tools' in metadata:
invalid_tool_configs = metadata[ 'invalid_tools' ]
for invalid_tool_config in invalid_tool_configs:
if invalid_tool_config not in processed_invalid_tool_configs:
- self.invalid_tools += 1
+ self.invalid_versions_of_tools += 1
processed_invalid_tool_configs.append( invalid_tool_config )
if 'datatypes' in metadata:
datatypes = metadata[ 'datatypes' ]
@@ -68,7 +82,7 @@
if 'extension' in datatypes_dict:
extension = datatypes_dict[ 'extension' ]
if extension not in processed_datatypes:
- self.proprietary_datatypes += 1
+ self.custom_datatypes += 1
processed_datatypes.append( extension )
if 'workflows' in metadata:
workflows = metadata[ 'workflows' ]
diff -r 9850950581c7792409ceb0fbfea06bac8fcda6f7 -r 880281e5f42210852a87724b01b4b2411e15a405 templates/webapps/tool_shed/admin/statistics.mako
--- a/templates/webapps/tool_shed/admin/statistics.mako
+++ b/templates/webapps/tool_shed/admin/statistics.mako
@@ -18,29 +18,37 @@
<td>Total repositories</td><td>${trans.app.shed_counter.repositories | h}</td></tr>
- ##<tr>
- ## <td>Empty repositories</td>
- ## <td>${trans.app.shed_counter.new_repositories | h}</td>
- ##</tr>
+ <tr>
+ <td>Unique owners</td>
+ <td>${trans.app.shed_counter.unique_owners | h}</td>
+ </tr>
+ <tr>
+ <td>Deprecated repositories</td>
+ <td>${trans.app.shed_counter.deprecated_repositories | h}</td>
+ </tr><tr><td>Deleted repositories</td><td>${trans.app.shed_counter.deleted_repositories | h}</td></tr><tr><td>Valid tools</td>
- <td>${trans.app.shed_counter.valid_tools | h}</td>
+ <td>${trans.app.shed_counter.unique_valid_tools | h}</td></tr><tr>
- <td>Invalid tools</td>
- <td>${trans.app.shed_counter.invalid_tools | h}</td>
+ <td>Valid versions of tools</td>
+ <td>${trans.app.shed_counter.valid_versions_of_tools | h}</td></tr><tr>
- <td>Workflows</td>
+ <td>Invalid versions of tools</td>
+ <td>${trans.app.shed_counter.invalid_versions_of_tools | h}</td>
+ </tr>
+ <tr>
+ <td>Exported Galaxy workflows</td><td>${trans.app.shed_counter.workflows | h}</td></tr><tr>
- <td>Proprietary datatypes</td>
- <td>${trans.app.shed_counter.proprietary_datatypes | h}</td>
+ <td>Custom datatypes</td>
+ <td>${trans.app.shed_counter.custom_datatypes | h}</td></tr><tr><td>Total clones</td>
diff -r 9850950581c7792409ceb0fbfea06bac8fcda6f7 -r 880281e5f42210852a87724b01b4b2411e15a405 templates/webapps/tool_shed/index.mako
--- a/templates/webapps/tool_shed/index.mako
+++ b/templates/webapps/tool_shed/index.mako
@@ -44,7 +44,7 @@
<%def name="left_panel()"><% can_review_repositories = trans.app.security_agent.user_can_review_repositories( trans.user ) %><div class="unified-panel-header" unselectable="on">
- <div class='unified-panel-header-inner'>${trans.app.shed_counter.valid_tools | h} valid tools on ${trans.app.shed_counter.generation_time | h}</div>
+ <div class='unified-panel-header-inner'>${trans.app.shed_counter.unique_valid_tools | h} valid tools on ${trans.app.shed_counter.generation_time | h}</div></div><div class="unified-panel-body"><div class="toolMenu">
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.
1
0
commit/galaxy-central: greg: Make sure metadata is associated with a repository when displaying values in the Verified column in the tool shed.
by commits-noreply@bitbucket.org 07 Mar '14
by commits-noreply@bitbucket.org 07 Mar '14
07 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9850950581c7/
Changeset: 9850950581c7
User: greg
Date: 2014-03-07 16:00:40
Summary: Make sure metadata is associated with a repository when displaying values in the Verified column in the tool shed.
Affected #: 1 file
diff -r 49d20516d8605f36590729564a83d188ec4d29bd -r 9850950581c7792409ceb0fbfea06bac8fcda6f7 lib/tool_shed/grids/repository_grids.py
--- a/lib/tool_shed/grids/repository_grids.py
+++ b/lib/tool_shed/grids/repository_grids.py
@@ -163,12 +163,13 @@
# This column will display the value associated with the currently displayed metadata revision.
if repository.type == rt_util.UNRESTRICTED:
try:
- displayed_metadata_revision = repository.metadata_revisions[ -1 ]
- if displayed_metadata_revision.includes_tools:
- if displayed_metadata_revision.tools_functionally_correct:
- return 'yes'
- else:
- return 'no'
+ if len( repository.metadata_revisions ) > 0:
+ displayed_metadata_revision = repository.metadata_revisions[ -1 ]
+ if displayed_metadata_revision.includes_tools:
+ if displayed_metadata_revision.tools_functionally_correct:
+ return 'yes'
+ else:
+ return 'no'
return 'n/a'
except Exception, e:
log.exception( str( e ) )
@@ -176,23 +177,23 @@
else:
# Here repository.type must be rt_util.TOOL_DEPENDENCY_DEFINITION.
try:
- displayed_metadata_revision = repository.metadata_revisions[ -1 ]
- if displayed_metadata_revision.test_install_error:
- return 'no'
- tool_test_results = listify( displayed_metadata_revision.tool_test_results )
- if len( tool_test_results ) > 0:
- last_tool_test_result = tool_test_results[ 0 ]
- installation_error_dict = last_tool_test_result.get( 'installation_errors', {} )
- if len( installation_error_dict ) > 0:
- current_repository_installation_error_dicts = installation_error_dict.get( 'current_repository', [] )
- if len( current_repository_installation_error_dicts ) > 0:
- return 'no'
+ if len( repository.metadata_revisions ) > 0:
+ displayed_metadata_revision = repository.metadata_revisions[ -1 ]
+ if displayed_metadata_revision.test_install_error:
+ return 'no'
+ tool_test_results = listify( displayed_metadata_revision.tool_test_results )
+ if len( tool_test_results ) > 0:
+ last_tool_test_result = tool_test_results[ 0 ]
+ installation_error_dict = last_tool_test_result.get( 'installation_errors', {} )
+ if len( installation_error_dict ) > 0:
+ current_repository_installation_error_dicts = installation_error_dict.get( 'current_repository', [] )
+ if len( current_repository_installation_error_dicts ) > 0:
+ return 'no'
+ else:
+ return 'yes'
else:
return 'yes'
- else:
- return 'yes'
- else:
- return 'no'
+ return 'no'
except Exception, e:
log.exception( str( e ) )
return 'unknown'
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.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/af15bddfe685/
Changeset: af15bddfe685
Branch: stable
User: davebgx
Date: 2014-03-07 15:42:39
Summary: Clean up another incorrectly resolved merge conflict.
Affected #: 1 file
diff -r 0bd594fc429dbad899a86495a3ab8683d6184159 -r af15bddfe6854f72d828b46490f8b6c3a4f79bfb lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -420,7 +420,6 @@
for tarball_name in tarball_names:
cmd = '''PATH=$PATH:$R_HOME/bin; export PATH; R_LIBS=$INSTALL_DIR; export R_LIBS;
Rscript -e "install.packages(c('%s'),lib='$INSTALL_DIR', repos=NULL, dependencies=FALSE)"''' % ( str( tarball_name ) )
- ( str( tarball_name ) )
cmd = install_environment.build_command( td_common_util.evaluate_template( cmd, install_dir ) )
return_code = handle_command( app, tool_dependency, install_dir, cmd )
if return_code:
https://bitbucket.org/galaxy/galaxy-central/commits/49d20516d860/
Changeset: 49d20516d860
User: davebgx
Date: 2014-03-07 15:45:24
Summary: Merge stable.
Affected #: 1 file
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.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/0bd594fc429d/
Changeset: 0bd594fc429d
Branch: stable
User: greg
Date: 2014-03-06 17:39:48
Summary: Fixes to handle case where a tool dependency recipe defines an <actions_group> tag set for installing pre-compiled binaries which fail to install, so the fall back recipe for installing and compileing from souce is used. Prior to this change set, the recipe from source would not work, but the install process would finish in such a way that the recipe seemed to work.
Affected #: 5 files
diff -r 18fa1f7340b3a5c99dda2e195b20373841d807e9 -r 0bd594fc429dbad899a86495a3ab8683d6184159 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -1111,10 +1111,12 @@
no_changes_checked = CheckboxField.is_checked( no_changes )
install_repository_dependencies = CheckboxField.is_checked( kwd.get( 'install_repository_dependencies', '' ) )
install_tool_dependencies = CheckboxField.is_checked( kwd.get( 'install_tool_dependencies', '' ) )
- shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, tool_shed_repository )
+ shed_tool_conf, tool_path, relative_install_dir = \
+ suc.get_tool_panel_config_tool_path_install_dir( trans.app, tool_shed_repository )
repository_clone_url = suc.generate_clone_url_for_installed_repository( trans.app, tool_shed_repository )
- clone_dir = os.path.join( tool_path, suc.generate_tool_shed_repository_install_dir( repository_clone_url,
- tool_shed_repository.installed_changeset_revision ) )
+ clone_dir = os.path.join( tool_path,
+ suc.generate_tool_shed_repository_install_dir( repository_clone_url,
+ tool_shed_repository.installed_changeset_revision ) )
relative_install_dir = os.path.join( clone_dir, tool_shed_repository.name )
tool_shed_url = suc.get_url_from_tool_shed( trans.app, tool_shed_repository.tool_shed )
tool_section = None
@@ -1123,7 +1125,8 @@
tool_panel_section_key = None
tool_panel_section_keys = []
metadata = tool_shed_repository.metadata
- # Keep track of tool dependencies defined for the current repository or those defined for any of it's repository dependencies.
+ # Keep track of tool dependencies defined for the current repository or those defined for any of
+ # it's repository dependencies.
includes_tool_dependencies = tool_shed_repository.includes_tool_dependencies
if tool_shed_repository.includes_tools_for_display_in_tool_panel:
# Handle the selected tool panel location for loading tools included in the tool shed repository.
@@ -1137,7 +1140,8 @@
# Just in case the tool_section.id differs from tool_panel_section_id, which it shouldn't...
tool_panel_section_id = str( tool_section.id )
if tool_shed_repository.status == trans.install_model.ToolShedRepository.installation_status.UNINSTALLED:
- # The repository's status must be updated from 'Uninstalled' to 'New' when initiating reinstall so the repository_installation_updater will function.
+ # The repository's status must be updated from 'Uninstalled' to 'New' when initiating reinstall
+ # so the repository_installation_updater will function.
tool_shed_repository = suc.create_or_update_tool_shed_repository( trans.app,
tool_shed_repository.name,
tool_shed_repository.description,
@@ -1163,7 +1167,8 @@
# Entering this else block occurs only if the tool_shed_repository does not include any valid tools.
if install_repository_dependencies:
repository_dependencies = \
- repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, tool_shed_repository )
+ repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans,
+ tool_shed_repository )
else:
repository_dependencies = None
if metadata:
@@ -1220,7 +1225,8 @@
clause_list = []
for tsr_id in tsr_ids:
clause_list.append( trans.install_model.ToolShedRepository.table.c.id == tsr_id )
- query = trans.install_model.context.current.query( trans.install_model.ToolShedRepository ).filter( or_( *clause_list ) )
+ query = trans.install_model.context.current.query( trans.install_model.ToolShedRepository ) \
+ .filter( or_( *clause_list ) )
return trans.fill_template( 'admin/tool_shed_repository/initiate_repository_installation.mako',
encoded_kwd=encoded_kwd,
query=query,
@@ -1378,7 +1384,9 @@
raw_text = common_util.tool_shed_get( trans.app, tool_shed_url, url )
readme_files_dict = json.from_json_string( raw_text )
tool_dependencies = metadata.get( 'tool_dependencies', None )
- repository_dependencies = repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, tool_shed_repository )
+ repository_dependencies = \
+ repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans,
+ tool_shed_repository )
repo_info_dict = repository_util.create_repo_info_dict( trans=trans,
repository_clone_url=repository_clone_url,
changeset_revision=tool_shed_repository.installed_changeset_revision,
diff -r 18fa1f7340b3a5c99dda2e195b20373841d807e9 -r 0bd594fc429dbad899a86495a3ab8683d6184159 lib/tool_shed/galaxy_install/repository_util.py
--- a/lib/tool_shed/galaxy_install/repository_util.py
+++ b/lib/tool_shed/galaxy_install/repository_util.py
@@ -30,36 +30,43 @@
log = logging.getLogger( __name__ )
-def create_repo_info_dict( trans, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_name=None, repository=None,
- repository_metadata=None, tool_dependencies=None, repository_dependencies=None ):
+def create_repo_info_dict( trans, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_name=None,
+ repository=None, repository_metadata=None, tool_dependencies=None, repository_dependencies=None ):
"""
- Return a dictionary that includes all of the information needed to install a repository into a local Galaxy instance. The dictionary will also
- contain the recursive list of repository dependencies defined for the repository, as well as the defined tool dependencies.
+ Return a dictionary that includes all of the information needed to install a repository into a local
+ Galaxy instance. The dictionary will also contain the recursive list of repository dependencies defined
+ for the repository, as well as the defined tool dependencies.
This method is called from Galaxy under three scenarios:
- 1. During the tool shed repository installation process via the tool shed's get_repository_information() method. In this case both the received
- repository and repository_metadata will be objects., but tool_dependencies and repository_dependencies will be None
- 2. When a tool shed repository that was uninstalled from a Galaxy instance is being reinstalled with no updates available. In this case, both
- repository and repository_metadata will be None, but tool_dependencies and repository_dependencies will be objects previously retrieved from the
- tool shed if the repository includes definitions for them.
- 3. When a tool shed repository that was uninstalled from a Galaxy instance is being reinstalled with updates available. In this case, this
- method is reached via the tool shed's get_updated_repository_information() method, and both repository and repository_metadata will be objects
- but tool_dependencies and repository_dependencies will be None.
+ 1. During the tool shed repository installation process via the tool shed's get_repository_information()
+ method. In this case both the received repository and repository_metadata will be objects., but
+ tool_dependencies and repository_dependencies will be None.
+ 2. When a tool shed repository that was uninstalled from a Galaxy instance is being reinstalled with no
+ updates available. In this case, both repository and repository_metadata will be None, but tool_dependencies
+ and repository_dependencies will be objects previously retrieved from the tool shed if the repository includes
+ definitions for them.
+ 3. When a tool shed repository that was uninstalled from a Galaxy instance is being reinstalled with updates
+ available. In this case, this method is reached via the tool shed's get_updated_repository_information()
+ method, and both repository and repository_metadata will be objects but tool_dependencies and
+ repository_dependencies will be None.
"""
repo_info_dict = {}
repository = suc.get_repository_by_name_and_owner( trans.app, repository_name, repository_owner )
if trans.webapp.name == 'tool_shed':
# We're in the tool shed.
- repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, trans.security.encode_id( repository.id ), changeset_revision )
+ repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans,
+ trans.security.encode_id( repository.id ),
+ changeset_revision )
if repository_metadata:
metadata = repository_metadata.metadata
if metadata:
+ toolshed_url = str( web.url_for( '/', qualified=True ) ).rstrip( '/' )
# Get a dictionary of all repositories upon which the contents of the received repository depends.
repository_dependencies = \
repository_dependency_util.get_repository_dependencies_for_changeset_revision( trans=trans,
repository=repository,
repository_metadata=repository_metadata,
- toolshed_base_url=str( web.url_for( '/', qualified=True ) ).rstrip( '/' ),
+ toolshed_base_url=toolshed_url,
key_rd_dicts_to_be_processed=None,
all_repository_dependencies=None,
handled_key_rd_dicts=None,
diff -r 18fa1f7340b3a5c99dda2e195b20373841d807e9 -r 0bd594fc429dbad899a86495a3ab8683d6184159 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -132,7 +132,6 @@
# Explicitly set the file to the received mode if valid.
with settings( hide( 'everything' ), warn_only=True ):
local( 'chmod +x %s' % file_path )
- return_code = 0
# Convert the received text to a list, in order to support adding one or more lines to the file.
if isinstance( text, basestring ):
text = [ text ]
@@ -152,7 +151,6 @@
if return_code:
# Return upon the first error encountered.
return return_code
- return return_code
def filter_actions_after_binary_installation( actions ):
'''Filter out actions that should not be processed if a binary download succeeded.'''
@@ -189,13 +187,15 @@
def handle_environment_variables( app, tool_dependency, install_dir, env_var_dict, set_prior_environment_commands ):
"""
- This method works with with a combination of three tool dependency definition tag sets, which are defined in the tool_dependencies.xml file in the
- order discussed here. The example for this discussion is the tool_dependencies.xml file contained in the osra repository, which is available at:
+ This method works with with a combination of three tool dependency definition tag sets, which are defined
+ in the tool_dependencies.xml file in the order discussed here. The example for this discussion is the
+ tool_dependencies.xml file contained in the osra repository, which is available at:
http://testtoolshed.g2.bx.psu.edu/view/bgruening/osra
- The first tag set defines a complex repository dependency like this. This tag set ensures that changeset revision XXX of the repository named
- package_graphicsmagick_1_3 owned by YYY in the tool shed ZZZ has been previously installed.
+ The first tag set defines a complex repository dependency like this. This tag set ensures that changeset
+ revision XXX of the repository named package_graphicsmagick_1_3 owned by YYY in the tool shed ZZZ has been
+ previously installed.
<tool_dependency><package name="graphicsmagick" version="1.3.18">
@@ -203,19 +203,21 @@
</package>
...
- * By the way, there is an env.sh file associated with version 1.3.18 of the graphicsmagick package which looks something like this (we'll reference
- this file later in this discussion.
+ * By the way, there is an env.sh file associated with version 1.3.18 of the graphicsmagick package which looks
+ something like this (we'll reference this file later in this discussion.
----
GRAPHICSMAGICK_ROOT_DIR=/<my configured tool dependency path>/graphicsmagick/1.3.18/YYY/package_graphicsmagick_1_3/XXX/gmagick;
export GRAPHICSMAGICK_ROOT_DIR
----
- The second tag set defines a specific package dependency that has been previously installed (guaranteed by the tag set discussed above) and compiled,
- where the compiled dependency is needed by the tool dependency currently being installed (osra version 2.0.0 in this case) and complied in order for
- it's installation and compilation to succeed. This tag set is contained within the <package name="osra" version="2.0.0"> tag set, which implies that
- version 2.0.0 of the osra package requires version 1.3.18 of the graphicsmagick package in order to successfully compile. When this tag set is handled,
- one of the effects is that the env.sh file associated with graphicsmagick version 1.3.18 is "sourced", which undoubtedly sets or alters certain environment
- variables (e.g. PATH, PYTHONPATH, etc).
+ The second tag set defines a specific package dependency that has been previously installed (guaranteed by the
+ tag set discussed above) and compiled, where the compiled dependency is needed by the tool dependency currently
+ being installed (osra version 2.0.0 in this case) and complied in order for it's installation and compilation to
+ succeed. This tag set is contained within the <package name="osra" version="2.0.0"> tag set, which implies that
+ version 2.0.0 of the osra package requires version 1.3.18 of the graphicsmagick package in order to successfully
+ compile. When this tag set is handled, one of the effects is that the env.sh file associated with graphicsmagick
+ version 1.3.18 is "sourced", which undoubtedly sets or alters certain environment variables (e.g. PATH, PYTHONPATH,
+ etc).
<!-- populate the environment variables from the dependent repositories --><action type="set_environment_for_install">
@@ -224,11 +226,12 @@
</repository></action>
- The third tag set enables discovery of the same required package dependency discussed above for correctly compiling the osra version 2.0.0 package, but
- in this case the package can be discovered at tool execution time. Using the $ENV[] option as shown in this example, the value of the environment
- variable named GRAPHICSMAGICK_ROOT_DIR (which was set in the environment using the second tag set described above) will be used to automatically alter
- the env.sh file associated with the osra version 2.0.0 tool dependency when it is installed into Galaxy. * Refer to where we discussed the env.sh file
- for version 1.3.18 of the graphicsmagick package above.
+ The third tag set enables discovery of the same required package dependency discussed above for correctly compiling
+ the osra version 2.0.0 package, but in this case the package can be discovered at tool execution time. Using the
+ $ENV[] option as shown in this example, the value of the environment variable named GRAPHICSMAGICK_ROOT_DIR (which
+ was set in the environment using the second tag set described above) will be used to automatically alter the env.sh
+ file associated with the osra version 2.0.0 tool dependency when it is installed into Galaxy. * Refer to where we
+ discussed the env.sh file for version 1.3.18 of the graphicsmagick package above.
<action type="set_environment"><environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[GRAPHICSMAGICK_ROOT_DIR]/lib/</environment_variable>
@@ -238,8 +241,9 @@
<environment_variable action="set_to" name="OSRA_DATA_FILES">$INSTALL_DIR/share</environment_variable></action>
- The above tag will produce an env.sh file for version 2.0.0 of the osra package when it it installed into Galaxy that looks something like this. Notice
- that the path to the gmagick binary is included here since it expands the defined $ENV[GRAPHICSMAGICK_ROOT_DIR] value in the above tag set.
+ The above tag will produce an env.sh file for version 2.0.0 of the osra package when it it installed into Galaxy
+ that looks something like this. Notice that the path to the gmagick binary is included here since it expands the
+ defined $ENV[GRAPHICSMAGICK_ROOT_DIR] value in the above tag set.
----
LD_LIBRARY_PATH=/<my configured tool dependency path>/graphicsmagick/1.3.18/YYY/package_graphicsmagick_1_3/XXX/gmagick/lib/:$LD_LIBRARY_PATH;
@@ -416,6 +420,7 @@
for tarball_name in tarball_names:
cmd = '''PATH=$PATH:$R_HOME/bin; export PATH; R_LIBS=$INSTALL_DIR; export R_LIBS;
Rscript -e "install.packages(c('%s'),lib='$INSTALL_DIR', repos=NULL, dependencies=FALSE)"''' % ( str( tarball_name ) )
+ ( str( tarball_name ) )
cmd = install_environment.build_command( td_common_util.evaluate_template( cmd, install_dir ) )
return_code = handle_command( app, tool_dependency, install_dir, cmd )
if return_code:
@@ -528,7 +533,8 @@
elif os.path.exists( os.path.join( tmp_work_dir, 'Build.PL' ) ):
cmd += '''perl Build.PL --install_base $INSTALL_DIR && perl Build && perl Build install'''
else:
- log.debug( 'No Makefile.PL or Build.PL file found in %s. Skipping installation of %s.' % ( url, perl_package_name ) )
+ log.debug( 'No Makefile.PL or Build.PL file found in %s. Skipping installation of %s.' % \
+ ( url, perl_package_name ) )
return tool_dependency
with lcd( tmp_work_dir ):
cmd = install_environment.build_command( td_common_util.evaluate_template( cmd, install_dir ) )
diff -r 18fa1f7340b3a5c99dda2e195b20373841d807e9 -r 0bd594fc429dbad899a86495a3ab8683d6184159 lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
@@ -300,7 +300,10 @@
return tool_dependency
def install_package( app, elem, tool_shed_repository, tool_dependencies=None, from_install_manager=False ):
- # The value of tool_dependencies is a partial or full list of ToolDependency records associated with the tool_shed_repository.
+ """
+ Install a tool dependency package defined by the XML element elem. The value of tool_dependencies is
+ a partial or full list of ToolDependency records associated with the tool_shed_repository.
+ """
sa_session = app.install_model.context
tool_dependency = None
# The value of package_name should match the value of the "package" type in the tool config's <requirements> tag set, but it's not required.
@@ -363,8 +366,8 @@
type='package',
status=app.install_model.ToolDependency.installation_status.INSTALLING,
set_status=True )
- # Get the information about the current platform in case the tool dependency definition includes tag sets for installing
- # compiled binaries.
+ # Get the information about the current platform in case the tool dependency definition includes tag sets
+ # for installing compiled binaries.
platform_info_dict = tool_dependency_util.get_platform_info_dict()
if package_install_version == '1.0':
# Handle tool dependency installation using a fabric method included in the Galaxy framework.
@@ -372,24 +375,29 @@
platform_info_dict=platform_info_dict,
include_after_install_actions=True )
if actions_elem_tuples:
- # At this point we have a list of <actions> elems that are either defined within an <actions_group> tag set with <actions>
- # sub-elements that contains os and architecture attributes filtered by the platform into which the appropriate compiled
- # binary will be installed, or not defined within an <actions_group> tag set and not filtered.
+ # At this point we have a list of <actions> elems that are either defined within an <actions_group>
+ # tag set with <actions> sub-elements that contains os and architecture attributes filtered by the
+ # platform into which the appropriate compiled binary will be installed, or not defined within an
+ # <actions_group> tag set and not filtered. Here is an example actions_elem_tuple.
+ # [(True, [<Element 'actions' at 0x109293d10>)]
binary_installed = False
- for in_actions_group, actions_elems in actions_elem_tuples:
+ for actions_elem_tuple in actions_elem_tuples:
+ in_actions_group, actions_elems = actions_elem_tuple
if in_actions_group:
- # Platform matching is only performed inside <actions_group> tag sets, os and architecture attributes are otherwise
- # ignored.
+ # Platform matching is only performed inside <actions_group> tag sets, os and architecture
+ # attributes are otherwise ignored.
+ can_install_from_source = False
for actions_elem in actions_elems:
system = actions_elem.get( 'os' )
architecture = actions_elem.get( 'architecture' )
- # If this <actions> element has the os and architecture attributes defined, then we only want to process until a
- # successful installation is achieved.
+ # If this <actions> element has the os and architecture attributes defined, then we only
+ # want to process until a successful installation is achieved.
if system and architecture:
- # If an <actions> tag has been defined that matches our current platform, and the recipe specified within
- # that <actions> tag has been successfully processed, skip any remaining platform-specific <actions> tags.
- # We cannot break out of the look here because there may be <action> tags at the end of the <actions_group>
- # tag set that must be processed.
+ # If an <actions> tag has been defined that matches our current platform, and the
+ # recipe specified within that <actions> tag has been successfully processed, skip
+ # any remaining platform-specific <actions> tags. We cannot break out of the loop
+ # here because there may be <action> tags at the end of the <actions_group> tag set
+ # that must be processed.
if binary_installed:
continue
# No platform-specific <actions> recipe has yet resulted in a successful installation.
@@ -400,41 +408,50 @@
actions_elem=actions_elem,
action_elem=None )
if tool_dependency.status == app.install_model.ToolDependency.installation_status.INSTALLED:
- # If an <actions> tag was found that matches the current platform, and the install_via_fabric method
- # did not result in an error state, set binary_installed to True in order to skip any remaining
- # platform-specific <actions> tags.
+ # If an <actions> tag was found that matches the current platform, and the
+ # install_via_fabric method did not result in an error state, set binary_installed
+ # to True in order to skip any remaining platform-specific <actions> tags.
binary_installed = True
else:
- # Process the next matching <actions> tag, or any defined <actions> tags that do not contain platform
- # dependent recipes.
+ # Process the next matching <actions> tag, or any defined <actions> tags that do not
+ # contain platform dependent recipes.
log.debug( 'Error downloading binary for tool dependency %s version %s: %s' % \
( str( package_name ), str( package_version ), str( tool_dependency.error_message ) ) )
else:
- # If no <actions> tags have been defined that match our current platform, or none of the matching
- # <actions> tags resulted in a successful tool dependency status, proceed with one and only one
- # <actions> tag that is not defined to be platform-specific.
- if not binary_installed:
- log.debug( 'Proceeding with install and compile recipe for tool dependency %s.' % str( tool_dependency.name ) )
- # Make sure to reset for installation if attempt at binary installation resulted in an error.
- can_install = True
- if tool_dependency.status != app.install_model.ToolDependency.installation_status.NEVER_INSTALLED:
- removed, error_message = tool_dependency_util.remove_tool_dependency( app, tool_dependency )
- if not removed:
- log.debug( 'Error removing old files from installation directory %s: %s' % \
- ( str( tool_dependency.installation_directory( app ), str( error_message ) ) ) )
- can_install = False
- if can_install:
+ if actions_elem.tag == 'actions':
+ # We've reached an <actions> tag that defines the recipe for installing and compiling from
+ # source. If binary installation failed, we proceed with the recipe.
+ if not binary_installed:
+ installation_directory = tool_dependency.installation_directory( app )
+ if os.path.exists( installation_directory ):
+ # Delete contents of installation directory if attempt at binary installation failed.
+ installation_directory_contents = os.listdir( installation_directory )
+ if installation_directory_contents:
+ removed, error_message = tool_dependency_util.remove_tool_dependency( app, tool_dependency )
+ if removed:
+ can_install_from_source = True
+ else:
+ log.debug( 'Error removing old files from installation directory %s: %s' % \
+ ( str( tool_dependency.installation_directory( app ), str( error_message ) ) ) )
+ else:
+ can_install_from_source = True
+ else:
+ can_install_from_source = True
+ if can_install_from_source:
+ # We now know that binary installation was not successful, so proceed with the <actions>
+ # tag set that defines the recipe to install and compile from source.
+ log.debug( 'Proceeding with install and compile recipe for tool dependency %s.' % \
+ str( tool_dependency.name ) )
tool_dependency = install_via_fabric( app,
tool_dependency,
install_dir,
package_name=package_name,
actions_elem=actions_elem,
action_elem=None )
- # Perform any final actions that have been defined within the actions_group tag set, but outside of
- # an <actions> tag, such as a set_environment entry, or a download_file or download_by_url command to
- # retrieve extra data for this tool dependency. Only do this if the tool dependency is not in an error
- # state, otherwise skip this action.
if actions_elem.tag == 'action' and tool_dependency.status != app.install_model.ToolDependency.installation_status.ERROR:
+ # If the tool dependency is not in an error state, perform any final actions that have been
+ # defined within the actions_group tag set, but outside of an <actions> tag, which defines
+ # the recipe for installing and compiling from source.
tool_dependency = install_via_fabric( app,
tool_dependency,
install_dir,
@@ -442,9 +459,9 @@
actions_elem=None,
action_elem=actions_elem )
else:
- # <actions> tags outside of an <actions_group> tag shall not check os or architecture, and if the attributes are
- # defined, they will be ignored. All <actions> tags outside of an <actions_group> tag set shall always be processed.
- # This is the default and original behavior of the install_package method.
+ # Checks for "os" and "architecture" attributes are not made for any <actions> tag sets outside of
+ # an <actions_group> tag set. If the attributes are defined, they will be ignored. All <actions> tags
+ # outside of an <actions_group> tag set will always be processed.
tool_dependency = install_via_fabric( app,
tool_dependency,
install_dir,
diff -r 18fa1f7340b3a5c99dda2e195b20373841d807e9 -r 0bd594fc429dbad899a86495a3ab8683d6184159 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -227,18 +227,21 @@
return file_path
return None
-def create_or_update_tool_shed_repository( app, name, description, installed_changeset_revision, ctx_rev, repository_clone_url, metadata_dict,
- status, current_changeset_revision=None, owner='', dist_to_shed=False ):
+def create_or_update_tool_shed_repository( app, name, description, installed_changeset_revision, ctx_rev, repository_clone_url,
+ metadata_dict, status, current_changeset_revision=None, owner='', dist_to_shed=False ):
"""
- Update a tool shed repository record in the Galaxy database with the new information received. If a record defined by the received tool shed,
- repository name and owner does not exist, create a new record with the received information.
+ Update a tool shed repository record in the Galaxy database with the new information received.
+ If a record defined by the received tool shed, repository name and owner does not exist, create
+ a new record with the received information.
"""
- # The received value for dist_to_shed will be True if the InstallManager is installing a repository that contains tools or datatypes that used
- # to be in the Galaxy distribution, but have been moved to the main Galaxy tool shed.
+ # The received value for dist_to_shed will be True if the InstallManager is installing a repository
+ # that contains tools or datatypes that used to be in the Galaxy distribution, but have been moved
+ # to the main Galaxy tool shed.
if current_changeset_revision is None:
- # The current_changeset_revision is not passed if a repository is being installed for the first time. If a previously installed repository
- # was later uninstalled, this value should be received as the value of that change set to which the repository had been updated just prior
- # to it being uninstalled.
+ # The current_changeset_revision is not passed if a repository is being installed for the first
+ # time. If a previously installed repository was later uninstalled, this value should be received
+ # as the value of that change set to which the repository had been updated just prior to it being
+ # uninstalled.
current_changeset_revision = installed_changeset_revision
context = app.install_model.context
tool_shed = get_tool_shed_from_clone_url( repository_clone_url )
@@ -255,9 +258,14 @@
deleted = False
uninstalled = False
tool_shed_repository = \
- get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app, tool_shed, name, owner, installed_changeset_revision )
+ get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app,
+ tool_shed,
+ name,
+ owner,
+ installed_changeset_revision )
if tool_shed_repository:
- log.debug( "Updating an existing row for repository '%s' in the tool_shed_repository table, status set to '%s'." % ( str( name ), str( status ) ) )
+ log.debug( "Updating an existing row for repository '%s' in the tool_shed_repository table, status set to '%s'." % \
+ ( str( name ), str( status ) ) )
tool_shed_repository.description = description
tool_shed_repository.changeset_revision = current_changeset_revision
tool_shed_repository.ctx_rev = ctx_rev
@@ -267,7 +275,8 @@
tool_shed_repository.uninstalled = uninstalled
tool_shed_repository.status = status
else:
- log.debug( "Adding new row for repository '%s' in the tool_shed_repository table, status set to '%s'." % ( str( name ), str( status ) ) )
+ log.debug( "Adding new row for repository '%s' in the tool_shed_repository table, status set to '%s'." % \
+ ( str( name ), str( status ) ) )
tool_shed_repository = \
app.install_model.ToolShedRepository( tool_shed=tool_shed,
name=name,
@@ -1028,8 +1037,8 @@
owner=owner,
changeset_revision=changeset_revision )
if not repository:
- # The received changeset_revision is no longer installable, so get the next changeset_revision in the repository's changelog in the
- # tool shed that is associated with repository_metadata.
+ # The received changeset_revision is no longer installable, so get the next changeset_revision
+ # in the repository's changelog in the tool shed that is associated with repository_metadata.
tool_shed_url = get_url_from_tool_shed( app, tool_shed )
url = url_join( tool_shed_url,
'repository/next_installable_changeset_revision?name=%s&owner=%s&changeset_revision=%s' % \
@@ -1305,7 +1314,10 @@
.first()
def get_tool_shed_repository_by_shed_name_owner_changeset_revision( app, tool_shed, name, owner, changeset_revision ):
- """Return a tool shed repository database record defined by the combination of a tool_shed, repository name, repository owner and current changeet_revision."""
+ """
+ Return a tool shed repository database record defined by the combination of a tool_shed, repository name,
+ repository owner and current changeet_revision.
+ """
# This method is used only in Galaxy, not the tool shed.
repository_query = __repository_query( app )
if tool_shed.find( '//' ) > 0:
@@ -1319,7 +1331,10 @@
.first()
def get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app, tool_shed, name, owner, installed_changeset_revision ):
- """Return a tool shed repository database record defined by the combination of a tool_shed, repository name, repository owner and installed_changeet_revision."""
+ """
+ Return a tool shed repository database record defined by the combination of a tool_shed,
+ repository name, repository owner and installed_changeet_revision.
+ """
# This method is used only in Galaxy, not the tool shed.
repository_query = __repository_query( app )
if tool_shed.find( '//' ) > 0:
https://bitbucket.org/galaxy/galaxy-central/commits/45b4499e1b0f/
Changeset: 45b4499e1b0f
User: davebgx
Date: 2014-03-07 15:25:51
Summary: Merge stable.
Affected #: 2 files
diff -r af5577a24c155fa04aa607ff2fec283634df2fb0 -r 45b4499e1b0f90f0bfa7b6bdc93f408cfb3b7d38 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -938,7 +938,10 @@
return tool_dependency
def log_results( command, fabric_AttributeString, file_path ):
- """Write attributes of fabric.operations._AttributeString to a specified log file."""
+ """
+ Write attributes of fabric.operations._AttributeString (which is the output of executing command using fabric's local() method)
+ to a specified log file.
+ """
if os.path.exists( file_path ):
logfile = open( file_path, 'ab' )
else:
https://bitbucket.org/galaxy/galaxy-central/commits/0eb68f4ec8ca/
Changeset: 0eb68f4ec8ca
User: davebgx
Date: 2014-03-07 15:28:30
Summary: Fix incorrectly merged comment.
Affected #: 1 file
diff -r 45b4499e1b0f90f0bfa7b6bdc93f408cfb3b7d38 -r 0eb68f4ec8ca0806991c7a1bdccf96350f3f0ef9 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -938,10 +938,7 @@
return tool_dependency
def log_results( command, fabric_AttributeString, file_path ):
- """
- Write attributes of fabric.operations._AttributeString (which is the output of executing command using fabric's local() method)
- to a specified log file.
- """
+ """Write attributes of fabric.operations._AttributeString to a specified log file."""
if os.path.exists( file_path ):
logfile = open( file_path, 'ab' )
else:
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.
1
0
commit/galaxy-central: jmchilton: Prevent 'unicode' strings being sent to pbs library as hostname.
by commits-noreply@bitbucket.org 07 Mar '14
by commits-noreply@bitbucket.org 07 Mar '14
07 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/af5577a24c15/
Changeset: af5577a24c15
User: jmchilton
Date: 2014-03-07 15:18:16
Summary: Prevent 'unicode' strings being sent to pbs library as hostname.
Full details here:
http://dev.list.galaxyproject.org/pbs-runner-deserializes-server-names-as-u…
Not sure this is the right thing to do - so I would welcome advice/comments.
Affected #: 1 file
diff -r 1b8b87437c7e0b8e7a9f6a51b0ec910237e514f1 -r af5577a24c155fa04aa607ff2fec283634df2fb0 lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py
+++ b/lib/galaxy/jobs/runners/pbs.py
@@ -5,6 +5,7 @@
from datetime import timedelta
from galaxy import model
+from galaxy import util
from galaxy.util.bunch import Bunch
from galaxy.util import DATABASE_MAX_STRING_SIZE, shrink_stream_by_size
from galaxy.jobs import JobDestination
@@ -233,7 +234,7 @@
# Explicitly set the determined PBS destination in the persisted job destination for recovery
job_destination.params['destination'] = '%s@%s' % (pbs_queue_name or '', pbs_server_name)
- c = pbs.pbs_connect( pbs_server_name )
+ c = pbs.pbs_connect( util.smart_str( pbs_server_name ) )
if c <= 0:
errno, text = pbs.error()
job_wrapper.fail( "Unable to queue job for execution. Resubmitting the job may succeed." )
@@ -449,7 +450,7 @@
servers.append( pbs_server_name )
pbs_job_state.check_count += 1
for pbs_server_name in servers:
- c = pbs.pbs_connect( pbs_server_name )
+ c = pbs.pbs_connect( util.smart_str( pbs_server_name ) )
if c <= 0:
log.debug("connection to PBS server %s for state check failed" % pbs_server_name )
failures.append( pbs_server_name )
@@ -482,7 +483,7 @@
Returns the state of a single job, used to make sure a job is
really dead.
"""
- c = pbs.pbs_connect( pbs_server_name )
+ c = pbs.pbs_connect( util.smart_str( pbs_server_name ) )
if c <= 0:
log.debug("connection to PBS server %s for state check failed" % pbs_server_name )
return None
@@ -584,7 +585,7 @@
log.debug("(%s) Job queued but no destination stored in job params, cannot delete"
% job_tag )
return
- c = pbs.pbs_connect( pbs_server_name )
+ c = pbs.pbs_connect( util.smart_str( pbs_server_name ) )
if c <= 0:
log.debug("(%s) Connection to PBS server for job delete failed"
% job_tag )
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.
1
0
commit/galaxy-central: guerler: Charts: Fix column number
by commits-noreply@bitbucket.org 07 Mar '14
by commits-noreply@bitbucket.org 07 Mar '14
07 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1b8b87437c7e/
Changeset: 1b8b87437c7e
User: guerler
Date: 2014-03-07 02:24:08
Summary: Charts: Fix column number
Affected #: 4 files
diff -r c58e14ae86d182f8152edbfe2569857da54ccb49 -r 1b8b87437c7e0b8e7a9f6a51b0ec910237e514f1 config/plugins/visualizations/charts/static/charts/histogram.js
--- a/config/plugins/visualizations/charts/static/charts/histogram.js
+++ b/config/plugins/visualizations/charts/static/charts/histogram.js
@@ -34,7 +34,11 @@
self.d3_chart = nv.models.multiBarChart();
self.d3_chart.xAxis.tickFormat(d3.format('.2f'))
- self.d3_chart.yAxis.tickFormat(d3.format('.1f'))
+ .axisLabel('Breaks');
+
+ self.d3_chart.yAxis.tickFormat(d3.format('.3f'))
+ .axisLabel('Frequency')
+ .axisLabelDistance(30);
self.options.svg.datum(data)
.call(self.d3_chart);
diff -r c58e14ae86d182f8152edbfe2569857da54ccb49 -r 1b8b87437c7e0b8e7a9f6a51b0ec910237e514f1 config/plugins/visualizations/charts/static/library/datasets.js
--- a/config/plugins/visualizations/charts/static/library/datasets.js
+++ b/config/plugins/visualizations/charts/static/library/datasets.js
@@ -115,7 +115,7 @@
// read value from row
var v = row[index];
- if(isNaN(v)) {
+ if(isNaN(v) || !v) {
v = 0;
}
diff -r c58e14ae86d182f8152edbfe2569857da54ccb49 -r 1b8b87437c7e0b8e7a9f6a51b0ec910237e514f1 config/plugins/visualizations/charts/static/models/types.js
--- a/config/plugins/visualizations/charts/static/models/types.js
+++ b/config/plugins/visualizations/charts/static/models/types.js
@@ -14,6 +14,14 @@
}
}
},
+ 'horizontal' : {
+ title : 'Bar diagram (horizontal)',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
+ },
'histogram' : {
title : 'Histogram',
mode : 'execute',
@@ -23,14 +31,6 @@
}
}
},
- 'horizontal' : {
- title : 'Bar diagram (horizontal)',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- }
- },
'line' : {
title : 'Line chart',
columns : {
diff -r c58e14ae86d182f8152edbfe2569857da54ccb49 -r 1b8b87437c7e0b8e7a9f6a51b0ec910237e514f1 config/plugins/visualizations/charts/static/views/viewport.js
--- a/config/plugins/visualizations/charts/static/views/viewport.js
+++ b/config/plugins/visualizations/charts/static/views/viewport.js
@@ -246,13 +246,12 @@
var group_index = 0;
chart.groups.each(function(group) {
for (var key in chart_settings.columns) {
- request_string += key + '_' + (++group_index) + ':' + group.get(key) + ', ';
+ request_string += key + '_' + (++group_index) + ':' + (parseInt(group.get(key)) + 1) + ', ';
}
});
// return
- return 'columns : 2';
- //return request_string.substring(0, request_string.length - 2);
+ return request_string.substring(0, request_string.length - 2);
},
// create default chart request
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.
1
0