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
May 2014
- 1 participants
- 242 discussions
31 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/da27d76bd099/
Changeset: da27d76bd099
User: guerler
Date: 2014-05-31 09:36:18
Summary: Charts: Fix table css
Affected #: 3 files
diff -r bc797256606a55ca3a793110a46740f869dd506f -r da27d76bd099477232423b3762bf393976c0c08b config/plugins/visualizations/charts/static/library/ui-table.js
--- a/config/plugins/visualizations/charts/static/library/ui-table.js
+++ b/config/plugins/visualizations/charts/static/library/ui-table.js
@@ -14,7 +14,7 @@
onchange : null,
ondblclick : null,
onconfirm : null,
- cls : 'grid'
+ cls : ''
},
// events
@@ -198,7 +198,7 @@
_template: function(options)
{
return '<div>' +
- '<table class="' + options.cls + '">' +
+ '<table class="ui-table ' + options.cls + '">' +
'<thead></thead>' +
'<tbody style="cursor: pointer;"></tbody>' +
'</table>' +
diff -r bc797256606a55ca3a793110a46740f869dd506f -r da27d76bd099477232423b3762bf393976c0c08b static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1460,7 +1460,7 @@
div.form-row-input{width:90%;float:left}
div.form-row-input label{font-weight:normal;display:inline}
div.form-row-error-message{width:300px;float:left;color:red;font-weight:bold;padding:3px 0}
-.form-row .help,.toolParamHelp{color:#666}.form-row .help a,.toolParamHelp a{color:#666}
+.form-row .help,.toolParamHelp,.ui-table-form-info{color:#666}.form-row .help a,.toolParamHelp a{color:#666}
.form-row.form-actions{background:whiteSmoke;border-top:solid #ddd 1px;padding-top:10px;padding-bottom:10px;margin-top:5px}
select{padding:2px;font-size:12px;line-height:1.428571429}
select,input,textarea{font:inherit}
@@ -1526,13 +1526,13 @@
.grid-header{padding-bottom:1em}
.grid-header h2{margin:0;margin-bottom:0.5em}
.grid-header .title{font-weight:bold}
-.grid{padding-top:1em;border-collapse:collapse;width:100%}
-.grid tbody td{line-height:1.428571429;border-top:solid #DDDDDD 1px;border-bottom:solid #DDDDDD 1px;padding:5px}
+.grid,.ui-table{padding-top:1em;border-collapse:collapse;width:100%}
+.grid tbody td,.ui-table tbody td{line-height:1.428571429;border-top:solid #DDDDDD 1px;border-bottom:solid #DDDDDD 1px;padding:5px}
.grid tbody td:empty{padding:0}
.grid thead tr{height:2em}
.grid thead th{line-height:1.428571429;background:#ebd9b2;color:#000;border-top:solid #d6b161 1px;border-bottom:solid #d6b161 1px;padding:5px;text-align:left;white-space:nowrap}
.grid tfoot td{background-color:#F8F8F8;border-top:solid #DDDDDD 1px;border-bottom:solid #DDDDDD 1px;padding:5px}
-.grid .current{background-color:#EEEEFF}
+.grid .current,.ui-table .current{background-color:#EEEEFF}
.count-box{min-width:1.1em;padding:5px;border-width:1px;border-style:solid;text-align:center;display:inline-block}
.text-filter-val{border:solid 1px #AAAAAA;padding:1px 2px 1px 3px;margin-right:5px;-moz-border-radius:.5em;-webkit-border-radius:.5em;font-style:italic}
.page-link a,.inactive-link{padding:0px 7px 0px 7px;color:#555}
diff -r bc797256606a55ca3a793110a46740f869dd506f -r da27d76bd099477232423b3762bf393976c0c08b static/style/src/less/ui.less
--- a/static/style/src/less/ui.less
+++ b/static/style/src/less/ui.less
@@ -1,3 +1,18 @@
+.ui-table {
+ &:extend(.grid);
+
+ tbody td {
+ &:extend(.grid tbody td);
+ }
+ .current {
+ &:extend(.grid .current);
+ }
+}
+
+.ui-table-form-info {
+ &:extend(.toolParamHelp);
+}
+
.ui-table-form-separator {
font-weight: bold;
font-size: 0.9em;
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: Ui/Charts: Improve css structure, pack scripts
by commits-noreply@bitbucket.org 31 May '14
by commits-noreply@bitbucket.org 31 May '14
31 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/bc797256606a/
Changeset: bc797256606a
User: guerler
Date: 2014-05-31 08:49:30
Summary: Ui/Charts: Improve css structure, pack scripts
Affected #: 10 files
diff -r 18db7291e89062110a3c81df9293a68935779c47 -r bc797256606a55ca3a793110a46740f869dd506f config/plugins/visualizations/charts/static/app.css
--- a/config/plugins/visualizations/charts/static/app.css
+++ b/config/plugins/visualizations/charts/static/app.css
@@ -1,29 +1,3 @@
-.ui-label {
- font-weight: bold;
-}
-.ui-message {
- padding: 2px 2px 2px 10px;
-}
-
-.ui-icon {
- font-size: 1.2em;
-}
-
-.ui-button-icon {
- margin-right: 5px;
-}
-
-.ui-button-icon .button {
- margin-right: 5px;
- margin-left: 5px;
-}
-
-.ui-button-icon .title {
- position: relative;
- font-size: 0.8em;
- font-weight: normal;
- top: -1px;
-}
.charts-grid .item {
padding: 5px;
diff -r 18db7291e89062110a3c81df9293a68935779c47 -r bc797256606a55ca3a793110a46740f869dd506f config/plugins/visualizations/charts/static/charts/types.js
--- a/config/plugins/visualizations/charts/static/charts/types.js
+++ b/config/plugins/visualizations/charts/static/charts/types.js
@@ -69,7 +69,7 @@
'nvd3_scatter' : nvd3_scatter,
'nvd3_histogram' : nvd3_histogram,
'nvd3_histogram_discrete' : nvd3_histogram_discrete,
- /*'highcharts_bar' : highcharts_bar,
+ 'highcharts_bar' : highcharts_bar,
'highcharts_bar_stacked' : highcharts_bar_stacked,
'highcharts_bar_horizontal' : highcharts_bar_horizontal,
'highcharts_bar_horizontal_stacked' : highcharts_bar_horizontal_stacked,
@@ -78,9 +78,9 @@
'highcharts_line' : highcharts_line,
'highcharts_scatter' : highcharts_scatter,
'highcharts_histogram' : highcharts_histogram,
- 'highcharts_histogram_discrete' : highcharts_histogram_discrete,*/
+ 'highcharts_histogram_discrete' : highcharts_histogram_discrete,
'highcharts_boxplot' : highcharts_boxplot,
- //'highcharts_heatmap' : highcharts_heatmap
+ 'highcharts_heatmap' : highcharts_heatmap
}
});
diff -r 18db7291e89062110a3c81df9293a68935779c47 -r bc797256606a55ca3a793110a46740f869dd506f config/plugins/visualizations/charts/static/library/ui-table-form.js
--- a/config/plugins/visualizations/charts/static/library/ui-table-form.js
+++ b/config/plugins/visualizations/charts/static/library/ui-table-form.js
@@ -16,14 +16,23 @@
list: [],
// initialize
- initialize: function(options) {
+ initialize: function(app, options) {
+
+ // link app
+ this.app = app;
+
+ // get options
+ this.options = Utils.merge(options, this.optionsDefault);
+
// ui elements
- this.table_title = new Ui.Label({title: options.title});
- this.table = new Table.View({content: options.content});
+ this.table_title = new Ui.Label({title: this.options.title});
+ this.table = new Table.View({content: this.options.content});
// create element
- var $view = $('<div/>');
- $view.append(Utils.wrap(this.table_title.$el));
+ var $view = $('<div class="ui-table-form"/>');
+ if (this.options.title) {
+ $view.append(Utils.wrap(this.table_title.$el));
+ }
$view.append(Utils.wrap(this.table.$el));
// add element
@@ -45,7 +54,7 @@
// load settings elements into table
for (var id in settings) {
- this._add(id, settings[id], model);
+ this._add(settings[id].id || id, settings[id], model);
}
// trigger change
@@ -68,7 +77,7 @@
// text input field
case 'text' :
field = new Ui.Input({
- id : 'field_' + id,
+ id : 'field-' + id,
placeholder : settings_def.placeholder,
value : model.get(id),
onchange : function(value) {
@@ -79,7 +88,7 @@
// select field
case 'select' :
field = new Ui.Select.View({
- id : 'field_' + id,
+ id : 'field-' + id,
data : settings_def.data,
value : model.get(id),
onchange : function(value) {
@@ -101,15 +110,63 @@
}
});
break;
+ case 'dataset':
+ field = new Ui.Select.View({
+ id : 'field-' + id,
+ onchange : function(value) {
+ // set new value
+ model.set(id, value);
+ }
+ });
+
+ // link refresh event
+ self.app.datasets.on('all', function() {
+ // identify selectables
+ var selectable = [];
+ self.app.datasets.each(function(dataset) {
+ if (dataset.get('datatype_id') == settings_def.data) {
+ selectable.push({value: dataset.get('id'), label: dataset.get('name')});
+ }
+ });
+
+ // update select field
+ field.update(selectable);
+
+ // set value
+ if (!model.get(id)) {
+ model.set(id, field.first());
+ }
+ field.value(model.get(id));
+ });
+
+ // trigger change
+ self.app.datasets.trigger('all.datasets');
+ break;
// slider input field
+ case 'textarea' :
+ field = new Ui.Textarea({
+ id : 'field-' + id,
+ onchange : function() {
+ model.set(id, field.value());
+ }
+ });
+ break;
+
+ // separator
case 'separator' :
field = $('<div/>');
break;
- // skip unkown types
+
+ // default
default:
- console.log('ui-table-form:_add', 'Unknown setting type (' + settings_def.type + ')');
- return;
-
+ field = new Ui.Input({
+ id : 'field-' + id,
+ placeholder : settings_def.placeholder,
+ type : settings_def.type,
+ onchange : function() {
+ model.set(id, field.value());
+ }
+ });
}
// set value
@@ -125,13 +182,20 @@
// combine field and info
var $input = $('<div/>');
$input.append(field.$el);
- $input.append('<div class="toolParamHelp" style="font-size: 0.9em;">' + settings_def.info + '</div>');
+ if (settings_def.info) {
+ $input.append('<div class="ui-table-form-info">' + settings_def.info + '</div>');
+ }
// add row to table
- this.table.add('<span style="white-space: nowrap;">' + settings_def.title + '</span>', '25%');
- this.table.add($input);
+ if (this.options.style == 'bold') {
+ this.table.add(new Ui.Label({title: settings_def.title, cls: 'form-label'}).$el);
+ this.table.add($input);
+ } else {
+ this.table.add('<span class="ui-table-form-title">' + settings_def.title + '</span>', '25%');
+ this.table.add($input);
+ }
} else {
- this.table.add('<h6 style="white-space: nowrap;">' + settings_def.title + ':<h6/>');
+ this.table.add('<div class="ui-table-form-separator">' + settings_def.title + ':<div/>');
this.table.add($('<div/>'));
}
diff -r 18db7291e89062110a3c81df9293a68935779c47 -r bc797256606a55ca3a793110a46740f869dd506f 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
@@ -472,7 +472,7 @@
placeholder : '',
disabled : false,
visible : true,
- cls : 'form-control'
+ cls : ''
},
// initialize
@@ -570,6 +570,60 @@
}
});
+// plugin
+var RadioButton = Backbone.View.extend(
+{
+ // options
+ optionsDefault: {
+ value : '',
+ type : 'text',
+ placeholder : '',
+ disabled : false,
+ visible : true,
+ cls : 'form-control'
+ },
+
+ // initialize
+ initialize : function(options) {
+ // configure options
+ this.options = Utils.merge(options, this.optionsDefault);
+
+ // create new element
+ this.setElement(this._template(this.options));
+
+ // disable input field
+ if (this.options.disabled) {
+ this.$el.prop('disabled', true);
+ }
+
+ // hide input field
+ if (!this.options.visible) {
+ this.$el.hide();
+ }
+
+ // onchange event handler. fires on user activity.
+ var self = this;
+ this.$el.on('input', function() {
+ if (self.options.onchange) {
+ self.options.onchange(self.$el.val());
+ }
+ });
+ },
+
+ // value
+ value : function (new_val) {
+ if (new_val !== undefined) {
+ this.$el.val(new_val);
+ }
+ return this.$el.val();
+ },
+
+ // element
+ _template: function(options) {
+ return '<input id="' + options.id + '" type="' + options.type + '" value="' + options.value + '" placeholder="' + options.placeholder + '" class="ui-input ' + options.cls + '">';
+ }
+});
+
// return
return {
Label : Label,
diff -r 18db7291e89062110a3c81df9293a68935779c47 -r bc797256606a55ca3a793110a46740f869dd506f static/scripts/mvc/ui/ui-modal.js
--- a/static/scripts/mvc/ui/ui-modal.js
+++ b/static/scripts/mvc/ui/ui-modal.js
@@ -173,7 +173,7 @@
// fill regular modal template
_template: function(title) {
- return '<div class="modal">' +
+ return '<div class="ui-modal modal">' +
'<div class="modal-backdrop fade in" style="z-index: -1;"></div>' +
'<div class="modal-dialog">' +
'<div class="modal-content">' +
diff -r 18db7291e89062110a3c81df9293a68935779c47 -r bc797256606a55ca3a793110a46740f869dd506f static/scripts/mvc/ui/ui-portlet.js
--- a/static/scripts/mvc/ui/ui-portlet.js
+++ b/static/scripts/mvc/ui/ui-portlet.js
@@ -39,19 +39,22 @@
// link title
this.$title = this.$el.find('#portlet-header-text');
- // set content height
+ // set content format
+ var $portlet_content = this.$el.find('#portlet-content');
if (!this.options.scrollable) {
if (this.options.title) {
- this.$el.find('#portlet-content').addClass('no-scroll');
+ $portlet_content.addClass('no-scroll');
} else {
- this.$el.find('#portlet-content').css('height', '100%');
+ $portlet_content.addClass('no-scroll-no-title');
}
+ } else {
+ $portlet_content.addClass('scroll');
}
- // set content height
+ // set content padding
if (this.options.nopadding) {
- this.$el.find('#portlet-content').css('padding', '0px');
- this.$el.find('#content').css('padding', '0px');
+ $portlet_content.css('padding', '0px');
+ $content.css('padding', '0px');
}
// append buttons
diff -r 18db7291e89062110a3c81df9293a68935779c47 -r bc797256606a55ca3a793110a46740f869dd506f static/scripts/packed/mvc/ui/ui-modal.js
--- a/static/scripts/packed/mvc/ui/ui-modal.js
+++ b/static/scripts/packed/mvc/ui/ui-modal.js
@@ -1,1 +1,1 @@
-define([],function(){var a=Backbone.View.extend({elMain:"body",optionsDefault:{title:"ui-modal",body:"",backdrop:true,height:null,width:null,closing_events:false,closing_callback:null},buttonList:{},initialize:function(b){if(b){this._create(b)}},show:function(b){this.initialize(b);if(this.options.height){this.$body.css("height",this.options.height);this.$body.css("overflow","hidden")}else{this.$body.css("max-height",$(window).height()/2)}if(this.options.width){this.$dialog.css("width",this.options.width)}if(this.visible){this.$el.show()}else{this.$el.fadeIn("fast")}this.visible=true},hide:function(){this.visible=false;this.$el.fadeOut("fast");if(this.options.closing_callback){this.options.closing_callback()}},enableButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).prop("disabled",false)},disableButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).prop("disabled",true)},showButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).show()},hideButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).hide()},getButton:function(b){var c=this.buttonList[b];return this.$buttons.find("#"+c)},scrollTop:function(){return this.$body.scrollTop()},_create:function(d){var c=this;this.options=_.defaults(d,this.optionsDefault);if(this.options.body=="progress"){this.options.body=$('<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%"></div></div>')}if(this.$el){this.$el.remove();$(document).off("keyup.ui-modal")}this.setElement(this._template(this.options.title));this.$dialog=(this.$el).find(".modal-dialog");this.$body=(this.$el).find(".modal-body");this.$footer=(this.$el).find(".modal-footer");this.$buttons=(this.$el).find(".buttons");this.$backdrop=(this.$el).find(".modal-backdrop");this.$body.html(this.options.body);if(!this.options.backdrop){this.$backdrop.removeClass("in")}if(this.options.buttons){this.buttonList={};var b=0;$.each(this.options.buttons,function(e,g){var f="button-"+b++;c.$buttons.append($('<button id="'+f+'"></button>').text(e).click(g)).append(" ");c.buttonList[e]=f})}else{this.$footer.hide()}$(this.elMain).append($(this.el));if(this.options.closing_events){$(document).on("keyup.ui-modal",function(f){if(f.keyCode==27){c.hide()}});this.$el.find(".modal-backdrop").on("click",function(){c.hide()})}},_template:function(b){return'<div class="modal"><div class="modal-backdrop fade in" style="z-index: -1;"></div><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" style="display: none;">×</button><h4 class="title">'+b+'</h4></div><div class="modal-body" style="position: static;"></div><div class="modal-footer"><div class="buttons" style="float: right;"></div></div></div</div></div>'}});return{View:a}});
\ No newline at end of file
+define([],function(){var a=Backbone.View.extend({elMain:"body",optionsDefault:{title:"ui-modal",body:"",backdrop:true,height:null,width:null,closing_events:false,closing_callback:null},buttonList:{},initialize:function(b){if(b){this._create(b)}},show:function(b){this.initialize(b);if(this.options.height){this.$body.css("height",this.options.height);this.$body.css("overflow","hidden")}else{this.$body.css("max-height",$(window).height()/2)}if(this.options.width){this.$dialog.css("width",this.options.width)}if(this.visible){this.$el.show()}else{this.$el.fadeIn("fast")}this.visible=true},hide:function(){this.visible=false;this.$el.fadeOut("fast");if(this.options.closing_callback){this.options.closing_callback()}},enableButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).prop("disabled",false)},disableButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).prop("disabled",true)},showButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).show()},hideButton:function(b){var c=this.buttonList[b];this.$buttons.find("#"+c).hide()},getButton:function(b){var c=this.buttonList[b];return this.$buttons.find("#"+c)},scrollTop:function(){return this.$body.scrollTop()},_create:function(d){var c=this;this.options=_.defaults(d,this.optionsDefault);if(this.options.body=="progress"){this.options.body=$('<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%"></div></div>')}if(this.$el){this.$el.remove();$(document).off("keyup.ui-modal")}this.setElement(this._template(this.options.title));this.$dialog=(this.$el).find(".modal-dialog");this.$body=(this.$el).find(".modal-body");this.$footer=(this.$el).find(".modal-footer");this.$buttons=(this.$el).find(".buttons");this.$backdrop=(this.$el).find(".modal-backdrop");this.$body.html(this.options.body);if(!this.options.backdrop){this.$backdrop.removeClass("in")}if(this.options.buttons){this.buttonList={};var b=0;$.each(this.options.buttons,function(e,g){var f="button-"+b++;c.$buttons.append($('<button id="'+f+'"></button>').text(e).click(g)).append(" ");c.buttonList[e]=f})}else{this.$footer.hide()}$(this.elMain).append($(this.el));if(this.options.closing_events){$(document).on("keyup.ui-modal",function(f){if(f.keyCode==27){c.hide()}});this.$el.find(".modal-backdrop").on("click",function(){c.hide()})}},_template:function(b){return'<div class="ui-modal modal"><div class="modal-backdrop fade in" style="z-index: -1;"></div><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" style="display: none;">×</button><h4 class="title">'+b+'</h4></div><div class="modal-body" style="position: static;"></div><div class="modal-footer"><div class="buttons" style="float: right;"></div></div></div</div></div>'}});return{View:a}});
\ No newline at end of file
diff -r 18db7291e89062110a3c81df9293a68935779c47 -r bc797256606a55ca3a793110a46740f869dd506f static/scripts/packed/mvc/ui/ui-portlet.js
--- a/static/scripts/packed/mvc/ui/ui-portlet.js
+++ b/static/scripts/packed/mvc/ui/ui-portlet.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){var b=Backbone.View.extend({visible:false,optionsDefault:{title:"",icon:"",buttons:null,body:null,scrollable:true,nopadding:false,operations:null,placement:"bottom"},$title:null,$content:null,$buttons:null,$operations:null,initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$content=this.$el.find("#content");this.$title=this.$el.find("#portlet-header-text");if(!this.options.scrollable){if(this.options.title){this.$el.find("#portlet-content").addClass("no-scroll")}else{this.$el.find("#portlet-content").css("height","100%")}}if(this.options.nopadding){this.$el.find("#portlet-content").css("padding","0px");this.$el.find("#content").css("padding","0px")}this.$buttons=$(this.el).find("#buttons");if(this.options.buttons){var c=this;$.each(this.options.buttons,function(e,f){f.$el.prop("id",e);c.$buttons.append(f.$el)})}else{this.$buttons.remove()}this.$operations=$(this.el).find("#operations");if(this.options.operations){var c=this;$.each(this.options.operations,function(e,f){f.$el.prop("id",e);c.$operations.append(f.$el)})}if(this.options.body){this.append(this.options.body)}},append:function(c){this.$content.append(a.wrap(c))},content:function(){return this.$content},show:function(){this.$el.fadeIn("fast");this.visible=true},hide:function(){this.$el.fadeOut("fast");this.visible=false},enableButton:function(c){this.$buttons.find("#"+c).prop("disabled",false)},disableButton:function(c){this.$buttons.find("#"+c).prop("disabled",true)},hideOperation:function(c){this.$operations.find("#"+c).hide()},showOperation:function(c){this.$operations.find("#"+c).show()},setOperation:function(e,d){var c=this.$operations.find("#"+e);c.off("click");c.on("click",d)},title:function(d){var c=this.$title;if(d){c.html(d)}return c.html()},_template:function(d){var c='<div class="ui-portlet">';if(d.title){c+='<div id="portlet-header" class="portlet-header"><div id="operations" style="float: right;"></div><h3>';if(d.icon){c+='<i class="icon fa '+d.icon+'"> </i>'}c+='<span id="portlet-header-text">'+d.title+"</span></h3></div>"}c+='<div id="portlet-content" class="portlet-content">';if(d.placement=="top"){c+='<div id="buttons" class="buttons"></div>'}c+='<div id="content" class="content"></div>';if(d.placement=="bottom"){c+='<div id="buttons" class="buttons"></div>'}c+="</div></div>";return c}});return{View:b}});
\ No newline at end of file
+define(["utils/utils"],function(a){var b=Backbone.View.extend({visible:false,optionsDefault:{title:"",icon:"",buttons:null,body:null,scrollable:true,nopadding:false,operations:null,placement:"bottom"},$title:null,$content:null,$buttons:null,$operations:null,initialize:function(e){this.options=a.merge(e,this.optionsDefault);this.setElement(this._template(this.options));this.$content=this.$el.find("#content");this.$title=this.$el.find("#portlet-header-text");var d=this.$el.find("#portlet-content");if(!this.options.scrollable){if(this.options.title){d.addClass("no-scroll")}else{d.addClass("no-scroll-no-title")}}else{d.addClass("scroll")}if(this.options.nopadding){d.css("padding","0px");$content.css("padding","0px")}this.$buttons=$(this.el).find("#buttons");if(this.options.buttons){var c=this;$.each(this.options.buttons,function(f,g){g.$el.prop("id",f);c.$buttons.append(g.$el)})}else{this.$buttons.remove()}this.$operations=$(this.el).find("#operations");if(this.options.operations){var c=this;$.each(this.options.operations,function(f,g){g.$el.prop("id",f);c.$operations.append(g.$el)})}if(this.options.body){this.append(this.options.body)}},append:function(c){this.$content.append(a.wrap(c))},content:function(){return this.$content},show:function(){this.$el.fadeIn("fast");this.visible=true},hide:function(){this.$el.fadeOut("fast");this.visible=false},enableButton:function(c){this.$buttons.find("#"+c).prop("disabled",false)},disableButton:function(c){this.$buttons.find("#"+c).prop("disabled",true)},hideOperation:function(c){this.$operations.find("#"+c).hide()},showOperation:function(c){this.$operations.find("#"+c).show()},setOperation:function(e,d){var c=this.$operations.find("#"+e);c.off("click");c.on("click",d)},title:function(d){var c=this.$title;if(d){c.html(d)}return c.html()},_template:function(d){var c='<div class="ui-portlet">';if(d.title){c+='<div id="portlet-header" class="portlet-header"><div id="operations" style="float: right;"></div><h3>';if(d.icon){c+='<i class="icon fa '+d.icon+'"> </i>'}c+='<span id="portlet-header-text">'+d.title+"</span></h3></div>"}c+='<div id="portlet-content" class="portlet-content">';if(d.placement=="top"){c+='<div id="buttons" class="buttons"></div>'}c+='<div id="content" class="content"></div>';if(d.placement=="bottom"){c+='<div id="buttons" class="buttons"></div>'}c+="</div></div>";return c}});return{View:b}});
\ No newline at end of file
diff -r 18db7291e89062110a3c81df9293a68935779c47 -r bc797256606a55ca3a793110a46740f869dd506f static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -148,7 +148,7 @@
.form-control::-moz-placeholder{color:#999}
.form-control:-ms-input-placeholder{color:#999}
.form-control::-webkit-input-placeholder{color:#999}
-.form-control{display:block;width:100%;height:27px;padding:4px 10px;font-size:12px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#fff;border:1px solid #aaa;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6)}
+.form-control,.ui-input{display:block;width:100%;height:27px;padding:4px 10px;font-size:12px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#fff;border:1px solid #aaa;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6)}
.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee}
textarea.form-control{height:auto}
.form-group{margin-bottom:15px}
@@ -1278,6 +1278,13 @@
.upload-ftp .upload-ftp-help{margin-bottom:10px}
.upload-ftp .upload-ftp-warning{text-align:center;margin-top:20px}
.upload-settings .upload-settings-cover{position:absolute;width:100%;height:100%;top:0px;left:0px;background:#fff;opacity:0.4;cursor:no-drop}
+.ui-table-form-separator{font-weight:bold;font-size:0.9em}
+.ui-label{font-weight:bold}
+.ui-message{padding:2px 2px 2px 10px}
+.ui-icon{font-size:1.2em}
+.ui-button-icon{margin-right:5px}
+.ui-button-icon .button{margin-right:5px;margin-left:5px}
+.ui-button-icon .title{position:relative;font-size:0.8em;font-weight:normal;top:-1px}
.ui-tabs .ui-tabs-add{font-size:0.8em;margin-right:5px}
.ui-tabs .ui-tabs-delete{font-size:0.8em;margin-left:5px;cursor:pointer}
.no-highlight{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none;}
diff -r 18db7291e89062110a3c81df9293a68935779c47 -r bc797256606a55ca3a793110a46740f869dd506f static/style/src/less/ui.less
--- a/static/style/src/less/ui.less
+++ b/static/style/src/less/ui.less
@@ -1,3 +1,40 @@
+.ui-table-form-separator {
+ font-weight: bold;
+ font-size: 0.9em;
+}
+
+.ui-label {
+ font-weight: bold;
+}
+
+.ui-message {
+ padding: 2px 2px 2px 10px;
+}
+
+.ui-icon {
+ font-size: 1.2em;
+}
+
+.ui-button-icon {
+ margin-right: 5px;
+}
+
+.ui-button-icon .button {
+ margin-right: 5px;
+ margin-left: 5px;
+}
+
+.ui-button-icon .title {
+ position: relative;
+ font-size: 0.8em;
+ font-weight: normal;
+ top: -1px;
+}
+
+.ui-input {
+ &:extend(.form-control);
+}
+
.ui-tabs {
.ui-tabs-add {
font-size : 0.8em;
@@ -56,7 +93,7 @@
.portlet-content {
height: inherit;
padding: 10px;
-
+
.content {
padding : 10px;
height : 100%;
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: Updated UI elements and styles, added zoomable charts
by commits-noreply@bitbucket.org 30 May '14
by commits-noreply@bitbucket.org 30 May '14
30 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/18db7291e890/
Changeset: 18db7291e890
User: guerler
Date: 2014-05-31 03:42:28
Summary: Updated UI elements and styles, added zoomable charts
Affected #: 159 files
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/app.css
--- a/config/plugins/visualizations/charts/static/app.css
+++ b/config/plugins/visualizations/charts/static/app.css
@@ -1,3 +1,30 @@
+.ui-label {
+ font-weight: bold;
+}
+.ui-message {
+ padding: 2px 2px 2px 10px;
+}
+
+.ui-icon {
+ font-size: 1.2em;
+}
+
+.ui-button-icon {
+ margin-right: 5px;
+}
+
+.ui-button-icon .button {
+ margin-right: 5px;
+ margin-left: 5px;
+}
+
+.ui-button-icon .title {
+ position: relative;
+ font-size: 0.8em;
+ font-weight: normal;
+ top: -1px;
+}
+
.charts-grid .item {
padding: 5px;
margin: 5px;
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/app.js
--- a/config/plugins/visualizations/charts/static/app.js
+++ b/config/plugins/visualizations/charts/static/app.js
@@ -86,6 +86,22 @@
}
},
+ // get root path
+ chartPath: function(chart_type) {
+ // create path from id
+ var path = chart_type.split(/_(.+)/);
+
+ // check path
+ if (path.length >= 2) {
+ // return path
+ return path[0] + '/' + path[1];
+ } else {
+ // log status
+ console.debug('FAILED App:chartPath() - Invalid format: ' + chart_type);
+ }
+ return undefined;
+ },
+
// execute command
execute: function(options) {
},
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/build-app.js
--- a/config/plugins/visualizations/charts/static/build-app.js
+++ b/config/plugins/visualizations/charts/static/build-app.js
@@ -3,4 +3,4 @@
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore may be freely distributed under the MIT license.
-define("mvc/ui/ui-modal",[],function(){var e=Backbone.View.extend({elMain:"body",optionsDefault:{title:"ui-modal",body:"",backdrop:!0,height:null,width:null,closing_events:!1,closing_callback:null},buttonList:{},initialize:function(e){e&&this._create(e)},show:function(e){this.initialize(e),this.options.height?(this.$body.css("height",this.options.height),this.$body.css("overflow","hidden")):this.$body.css("max-height",$(window).height()/2),this.options.width&&this.$dialog.css("width",this.options.width),this.visible?this.$el.show():this.$el.fadeIn("fast"),this.visible=!0},hide:function(){this.visible=!1,this.$el.fadeOut("fast"),this.options.closing_callback&&this.options.closing_callback()},enableButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).prop("disabled",!1)},disableButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).prop("disabled",!0)},showButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).show()},hideButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).hide()},getButton:function(e){var t=this.buttonList[e];return this.$buttons.find("#"+t)},scrollTop:function(){return this.$body.scrollTop()},_create:function(e){var t=this;this.options=_.defaults(e,this.optionsDefault),this.options.body=="progress"&&(this.options.body=$('<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%"></div></div>')),this.$el&&(this.$el.remove(),$(document).off("keyup.ui-modal")),this.setElement(this._template(this.options.title)),this.$dialog=this.$el.find(".modal-dialog"),this.$body=this.$el.find(".modal-body"),this.$footer=this.$el.find(".modal-footer"),this.$buttons=this.$el.find(".buttons"),this.$backdrop=this.$el.find(".modal-backdrop"),this.$body.html(this.options.body),this.options.backdrop||this.$backdrop.removeClass("in");if(this.options.buttons){this.buttonList={};var n=0;$.each(this.options.buttons,function(e,r){var i="button-"+n++;t.$buttons.append($('<button id="'+i+'"></button>').text(e).click(r)).append(" "),t.buttonList[e]=i})}else this.$footer.hide();$(this.elMain).append($(this.el)),this.options.closing_events&&($(document).on("keyup.ui-modal",function(e){e.keyCode==27&&t.hide()}),this.$el.find(".modal-backdrop").on("click",function(){t.hide()}))},_template:function(e){return'<div class="modal"><div class="modal-backdrop fade in" style="z-index: -1;"></div><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" style="display: none;">×</button><h4 class="title">'+e+"</h4>"+"</div>"+'<div class="modal-body" style="position: static;"></div>'+'<div class="modal-footer">'+'<div class="buttons" style="float: right;"></div>'+"</div>"+"</div"+"</div>"+"</div>"}});return{View:e}}),function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.4.4";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else for(var o in e)if(x.has(e,o)&&t.call(r,e[o],o,e)===n)return};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r.push(t.call(n,e,i,s))}),r)};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?void 0:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},x.shuffle=function(e){var t,n=0,r=[];return T(e,function(e){t=x.random(n++),r[n-1]=r[t],r[t]=e}),r};var k=function(e){return x.isFunction(e)?e:function(t){return t[e]}};x.sortBy=function(e,t,n){var r=k(t);return x.pluck(x.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index<t.index?-1:1}),"value")};var L=function(e,t,n,r){var i={},s=k(t==null?x.identity:t);return T(e,function(t,o){var u=s.call(n,t,o,e);r(i,u,t)}),i};x.groupBy=function(e,t,n){return L(e,t,n,function(e,t,n){(x.has(e,t)?e[t]:e[t]=[]).push(n)})},x.countBy=function(e,t,n){return L(e,t,n,function(e,t){x.has(e,t)||(e[t]=0),e[t]++})},x.sortedIndex=function(e,t,n,r){n=n==null?x.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},x.toArray=function(e){return e?x.isArray(e)?u.call(e):e.length===+e.length?x.map(e,x.identity):x.values(e):[]},x.size=function(e){return e==null?0:e.length===+e.length?e.length:x.keys(e).length},x.first=x.head=x.take=function(e,t,n){return e==null?void 0:t!=null&&!n?u.call(e,0,t):e[0]},x.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},x.last=function(e,t,n){return e==null?void 0:t!=null&&!n?u.call(e,Math.max(e.length-t,0)):e[e.length-1]},x.rest=x.tail=x.drop=function(e,t,n){return u.call(e,t==null||n?1:t)},x.compact=function(e){return x.filter(e,x.identity)};var A=function(e,t,n){return T(e,function(e){x.isArray(e)?t?o.apply(n,e):A(e,t,n):n.push(e)}),n};x.flatten=function(e,t){return A(e,t,[])},x.without=function(e){return x.difference(e,u.call(arguments,1))},x.uniq=x.unique=function(e,t,n,r){x.isFunction(t)&&(r=n,n=t,t=!1);var i=n?x.map(e,n,r):e,s=[],o=[];return T(i,function(n,r){if(t?!r||o[o.length-1]!==n:!x.contains(o,n))o.push(n),s.push(e[r])}),s},x.union=function(){return x.uniq(a.apply(r,arguments))},x.intersection=function(e){var t=u.call(arguments,1);return x.filter(x.uniq(e),function(e){return x.every(t,function(t){return x.indexOf(t,e)>=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=u.call(arguments),t=x.max(x.pluck(e,"length")),n=new Array(t);for(var r=0;r<t;r++)n[r]=x.pluck(e,""+r);return n},x.unzip=function(e){var t=[];return x.each(e,function(e,n){x.each(e,function(e,r){t.length<=r&&(t[r]=[]),t[r][n]=e})}),t},x.object=function(e,t){if(e==null)return{};var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},x.indexOf=function(e,t,n){if(e==null)return-1;var r=0,i=e.length;if(n){if(typeof n!="number")return r=x.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(y&&e.indexOf===y)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},x.lastIndexOf=function(e,t,n){if(e==null)return-1;var r=n!=null;if(b&&e.lastIndexOf===b)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);var i=r?n:e.length;while(i--)if(e[i]===t)return i;return-1},x.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var O=function(){};x.bind=function(e,t){var n,r;if(e.bind===S&&S)return S.apply(e,u.call(arguments,1));if(!x.isFunction(e))throw new TypeError;return n=u.call(arguments,2),r=function(){if(this instanceof r){O.prototype=e.prototype;var i=new O;O.prototype=null;var s=e.apply(i,n.concat(u.call(arguments)));return Object(s)===s?s:i}return e.apply(t,n.concat(u.call(arguments)))}},x.partial=function(e){var t=u.call(arguments,1);return function(){return e.apply(this,t.concat(u.call(arguments)))}},x.bindAll=function(e){var t=u.call(arguments,1);if(t.length===0)throw new Error("bindAll must be passed function names");return T(t,function(t){e[t]=x.bind(e[t],e)}),e},x.memoize=function(e,t){var n={};return t||(t=x.identity),function(){var r=t.apply(this,arguments);return x.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},x.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=function(e){return x.delay.apply(x,[e,1].concat(u.call(arguments,1)))},x.throttle=function(e,t,n){var r,i,s,o,u=0,a=function(){u=new Date,s=null,o=e.apply(r,i)};return function(){var f=new Date;!u&&n===!1&&(u=f);var l=t-(f-u);return r=this,i=arguments,l<=0?(clearTimeout(s),s=null,u=f,o=e.apply(r,i)):s||(s=setTimeout(a,l)),o}},x.debounce=function(e,t,n){var r,i;return function(){var s=this,o=arguments,u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r;return clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},x.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},x.wrap=function(e,t){return function(){var n=[e];return o.apply(n,arguments),t.apply(this,n)}},x.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&t.push(n);return t},x.values=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push(e[n]);return t},x.pairs=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push([n,e[n]]);return t},x.invert=function(e){var t={};for(var n in e)x.has(e,n)&&(t[e[n]]=n);return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=M(e[o],t[o],n,r)))break}else{var a=e.constructor,l=t.constructor;if(a!==l&&!(x.isFunction(a)&&a instanceof a&&x.isFunction(l)&&l instanceof l))return!1;for(var c in e)if(x.has(e,c)){o++;if(!(u=x.has(t,c)&&M(e[c],t[c],n,r)))break}if(u){for(c in t)if(x.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};x.isEqual=function(e,t){return M(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(e);for(var i=0;i<e;i++)r[i]=t.call(n,i);return r},x.random=function(e,t){return t==null&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var _={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};_.unescape=x.invert(_.escape);var D={escape:new RegExp("["+x.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(_.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),x.result=function(e,t){if(e==null)return void 0;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(x,e))}})};var P=0;x.uniqueId=function(e){var t=++P+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(j,function(e){return"\\"+B[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var F=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("libs/underscore",function(e){return function(){var t,n;return t||e._}}(this)),define("utils/utils",["libs/underscore"],function(e){function t(e,t,r){n("GET",e,{},t,r)}function n(e,t,n,r,i){if(e=="GET"||e=="DELETE")t.indexOf("?")==-1?t+="?":t+="&",t+=$.param(n);var s=new XMLHttpRequest;s.open(e,t,!0),s.setRequestHeader("Accept","application/json"),s.setRequestHeader("Cache-Control","no-cache"),s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.setRequestHeader("Content-Type","application/json"),s.onloadend=function(){var e=s.status;try{response=jQuery.parseJSON(s.responseText)}catch(t){response=s.responseText}e==200?r&&r(response):i&&i(response)},e=="GET"||e=="DELETE"?s.send():s.send(JSON.stringify(n))}function r(e,t){var n=$('<div class="'+e+'"></div>');n.appendTo(":eq(0)");var r=n.css(t);return n.remove(),r}function i(e){$('link[href^="'+e+'"]').length||$('<link href="'+galaxy_config.root+e+'" rel="stylesheet">').appendTo("head")}function s(t,n){return t?e.defaults(t,n):n}function o(e,t){var n="";if(e>=1e11)e/=1e11,n="TB";else if(e>=1e8)e/=1e8,n="GB";else if(e>=1e5)e/=1e5,n="MB";else if(e>=100)e/=100,n="KB";else{if(!(e>0))return"<strong>-</strong>";e*=10,n="b"}var r=Math.round(e)/10;return t?r+" "+n:"<strong>"+r+"</strong> "+n}function u(){return(new Date).getTime().toString(36)}function a(e){var t=$("<p></p>");return t.append(e),t}function f(){var e=new Date,t=(e.getHours()<10?"0":"")+e.getHours(),n=(e.getMinutes()<10?"0":"")+e.getMinutes(),r=e.getDate()+"/"+(e.getMonth()+1)+"/"+e.getFullYear()+", "+t+":"+n;return r}return{cssLoadFile:i,cssGetAttribute:r,get:t,merge:s,bytesToString:o,uuid:u,time:f,wrap:a,request:n}}),define("mvc/ui/ui-portlet",["utils/utils"],function(e){var t=Backbone.View.extend({visible:!1,optionsDefault:{title:"",icon:"",buttons:null,body:null,height:null,operations:null,placement:"bottom",overflow:"auto"},$title:null,$content:null,$buttons:null,$operations:null,initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),this.$content=this.$el.find("#content"),this.$title=this.$el.find("#title-text"),this.options.height&&(this.$el.find("#body").css("height",this.options.height),this.$el.find("#content").css("overflow",this.options.overflow)),this.$buttons=$(this.el).find("#buttons");if(this.options.buttons){var n=this;$.each(this.options.buttons,function(e,t){t.$el.prop("id",e),n.$buttons.append(t.$el)})}else this.$buttons.remove();this.$operations=$(this.el).find("#operations");if(this.options.operations){var n=this;$.each(this.options.operations,function(e,t){t.$el.prop("id",e),n.$operations.append(t.$el)})}this.options.body&&this.append(this.options.body)},append:function(t){this.$content.append(e.wrap(t))},content:function(){return this.$content},show:function(){this.$el.fadeIn("fast"),this.visible=!0},hide:function(){this.$el.fadeOut("fast"),this.visible=!1},enableButton:function(e){this.$buttons.find("#"+e).prop("disabled",!1)},disableButton:function(e){this.$buttons.find("#"+e).prop("disabled",!0)},hideOperation:function(e){this.$operations.find("#"+e).hide()},showOperation:function(e){this.$operations.find("#"+e).show()},setOperation:function(e,t){var n=this.$operations.find("#"+e);n.off("click"),n.on("click",t)},title:function(e){var t=this.$title;return e&&t.html(e),t.html()},_template:function(e){var t='<div class="toolForm portlet-view no-highlight">';if(e.title||e.icon)t+='<div id="title" class="toolFormTitle portlet-title"><div id="operations" class="portlet-operations"/><div style="overflow: hidden;">',e.icon&&(t+='<div class="portlet-title-icon fa '+e.icon+'"> </div>'),t+='<div id="title-text" class="portlet-title-text">'+e.title+"</div>",t+="</div></div>";return t+='<div id="body" class="toolFormBody portlet-body">',e.placement=="top"&&(t+='<div id="buttons" class="portlet-buttons"/>'),t+='<div id="content" class="portlet-content"/>',e.placement=="bottom"&&(t+='<div id="buttons" class="portlet-buttons"/>'),t+="</div></div>",t}});return{View:t}}),define("plugin/library/ui-select",["utils/utils"],function(e){var t=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:!0,wait:!1},selected:null,initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.selected=this.options.value,this.setElement(this._template(this.options)),this.$select=this.$el.find("#select"),this.$icon=this.$el.find("#icon");var n=this;this.$select.on("change",function(){n.value(n.$select.val())}),this.on("change",function(){n.options.onchange&&n.options.onchange(n.value())}),this._refresh(),this.options.visible||this.hide(),this.options.wait?this.wait():this.show()},value:function(e){var t=this.selected;e!==undefined&&(this.selected=e,this.$select.val(e));var n=this.selected;return n&&n!=t&&this.options.onchange&&this.options.onchange(n),n},first:function(){var e=this.$select.find("option");return e.length>0?e.val():undefined},text:function(){return this.$select.find("option:selected").text()},show:function(){this.$icon.removeClass(),this.$icon.addClass("fa fa-caret-down"),this.$select.show(),this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass(),this.$icon.addClass("fa fa-spinner fa-spin"),this.$select.hide()},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",!1)},disable:function(){this.$select.prop("disabled",!0)},add:function(e){this.$select.append(this._templateOption(e)),this._refresh()},del:function(e){this.$select.find("option[value="+e+"]").remove(),this.$select.trigger("change"),this._refresh()},update:function(e){this.$select.find("option").remove();for(var t in e)this.$select.append(this._templateOption(e[t]));this._refresh()},setOnChange:function(e){this.options.onchange=e},exists:function(e){return this.$select.find("option[value="+e+"]").length>0},_refresh:function(){this.$select.find("option[value=null]").remove();var e=this.$select.find("option").length;e==0?(this.disable(),this.$select.append(this._templateOption({value:"null",label:this.options.empty}))):this.enable(),this.selected&&this.$select.val(this.selected)},_templateOption:function(e){return'<option value="'+e.value+'">'+e.label+"</option>"},_template:function(e){var t='<div id="'+e.id+'" class="styled-select">'+'<div class="button">'+'<i id="icon"/>'+"</div>"+'<select id="select" class="select '+e.cls+" "+e.id+'">';for(key in e.data){var n=e.data[key],r="";if(n.value==e.value||n.value=="")r="selected";t+='<option value="'+n.value+'" '+r+">"+n.label+"</option>"}return t+="</select></div>",t}});return{View:t}}),define("plugin/library/ui",["utils/utils","plugin/library/ui-select"],function(e,t){var n=Backbone.View.extend({optionsDefault:{url:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options))},_template:function(e){return'<img src="'+e.url+'"/>'}}),r=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options))},title:function(e){this.$el.find("b").html(e)},_template:function(e){return'<label class="'+e.cls+'"><b>'+e.title+"</b></label>"},value:function(){return options.title}}),i=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options))},title:function(e){this.$el.html(e)},_template:function(e){return'<div class="'+e.cls+'">'+e.title+"</div>"},value:function(){return options.title}}),s=Backbone.View.extend({optionsDefault:{id:null,title:"","float":"right",cls:"btn-default",icon:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",t.onclick),$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},_template:function(e){var t='<button id="'+e.id+'" type="submit" style="margin-right: 5px; float: '+e.float+';" type="button" class="btn '+e.cls+'">';return e.icon&&(t+='<i class="icon fa '+e.icon+'"></i> '),t+=e.title+"</button>",t}}),o=Backbone.View.extend({optionsDefault:{title:"",id:null,"float":"right",cls:"icon-btn",icon:"",tooltip:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",t.onclick),$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},_template:function(e){var t="";e.title&&(t="width: auto;");var n='<div id="'+e.id+'" style="margin-right: 5px; float: '+e.float+"; "+t+'" class="'+e.cls+'">';return e.title?n+='<div style="margin-right: 5px; margin-left: 5px;"><i class="icon fa '+e.icon+'"/> '+'<span style="position: relative; font-size: 0.8em; font-weight: normal; top: -1px;">'+e.title+"</span>"+"</div>":n+='<i class="icon fa '+e.icon+'"/>',n+="</div>",n}}),u=Backbone.View.extend({optionsDefault:{"float":"right",icon:"",tooltip:"",placement:"bottom",title:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},_template:function(e){return'<div><span class="fa '+e.icon+'" style="font-size: 1.2em;"/> '+e.title+"</div>"}}),a=Backbone.View.extend({optionsDefault:{title:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",t.onclick)},_template:function(e){return'<div><a href="javascript:void(0)">'+e.title+"</a></div>"}}),f=Backbone.View.extend({optionsDefault:{message:"",status:"info",persistent:!1},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement("<div></div>")},update:function(t){this.options=e.merge(t,this.optionsDefault);if(t.message!=""){this.$el.html(this._template(this.options)),this.$el.fadeIn();if(!t.persistent){var n=this;window.setTimeout(function(){n.$el.is(":visible")?n.$el.fadeOut():n.$el.hide()},3e3)}}else this.$el.fadeOut()},_template:function(e){return'<div class="alert alert-'+e.status+'" style="padding: 2px 2px 2px 10px;">'+e.message+"</div>"}}),l=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options));var n=this;this.options.onclick&&this.$el.on("submit",function(e){var t=n.$el.find("#search");n.options.onclick(t.val())})},_template:function(e){return'<div class="search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+e.searchword+'">'+'<button type="submit" class="btn search-btn">'+'<i class="fa fa-search"></i>'+"</button>"+"</form>"+"</div>"}}),c=Backbone.View.extend({optionsDefault:{title:"Unlabeled",body:null},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),this.options.body&&this.$el.find(".body").append(this.options.body)},_template:function(e){return'<div id="title" class="title">'+e.title+":"+"</div>"}}),h=Backbone.View.extend({optionsDefault:{id:"",title:"",target:"",href:"",onunload:null,onclick:null,visible:!0,icon:null,tag:""},$menu:null,initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement($(this._template(this.options)));var n=$(this.el).find(".root"),r=this;n.on("click",function(e){e.preventDefault(),r.options.onclick&&r.options.onclick()}),this.options.visible||this.hide()},show:function(){$(this.el).show()},hide:function(){$(this.el).hide()},addMenu:function(t){var n={title:"",target:"",href:"",onclick:null,divider:!1,icon:null};n=e.merge(t,n),this.$menu||($(this.el).append(this._templateMenu()),this.$menu=$(this.el).find(".menu"));var r=$(this._templateMenuItem(n));r.on("click",function(e){e.preventDefault(),n.onclick&&n.onclick()}),this.$menu.append(r),n.divider&&this.$menu.append($(this._templateDivider()))},_templateMenuItem:function(e){var t='<li><a href="'+e.href+'" target="'+e.target+'">';return e.icon&&(t+='<i class="fa '+e.icon+'"></i>'),t+=" "+e.title+"</a>"+"</li>",t},_templateMenu:function(){return'<ul class="menu dropdown-menu pull-right" role="menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(e){var t='<div id="'+e.id+'" class="button-menu btn-group">'+'<button type="button" class="root btn btn-default dropdown-toggle" data-toggle="dropdown">';return e.icon&&(t+='<i class="fa '+e.icon+'"></i>'),t+="</button></div>",t}}),p=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:!1,visible:!0},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),this.options.disabled&&this.$el.prop("disabled",!0),this.options.visible||this.$el.hide();var n=this;this.$el.on("input",function(){n.options.onchange&&n.options.onchange(n.$el.val())})},value:function(e){return e!==undefined&&this.$el.val(e),this.$el.val()},_template:function(e){return'<input id="'+e.id+'" type="'+e.type+'" value="'+e.value+'" placeholder="'+e.placeholder+'" class="form-control">'}});return{Label:r,Image:n,Button:s,Icon:u,ButtonIcon:o,Input:p,Anchor:a,Message:f,Searchbox:l,Title:c,Text:i,Select:t,ButtonMenu:h}}),define("plugin/library/jobs",["utils/utils"],function(e){return Backbone.Model.extend({initialize:function(t,n){this.app=t,this.options=e.merge(n,this.optionsDefault)},request:function(e,t,n,r,i){var s=this;e.state("wait","Requesting job results...");var o=e.get("dataset_id_job");o!=""?s._wait(e,r,i):s._submit(e,t,n,r,i)},cleanup:function(t){var n=this,r=t.get("dataset_id_job");r!=""&&(e.request("PUT",config.root+"api/histories/none/contents/"+r,{deleted:!0},function(){n._refreshHdas()}),t.set("dataset_id_job",""))},_submit:function(t,n,r,i,s){var o=this,u=t.id,a=t.get("type"),f=this.app.types.get(a);data={tool_id:"charts",inputs:{input:{id:t.get("dataset_id"),src:"hda"},module:f.execute,columns:r,settings:n}},t.state("wait","Sending job request..."),e.request("POST",config.root+"api/tools",data,function(e){if(!e.outputs||e.outputs.length==0)t.state("failed","Job submission failed. No response."),s&&s();else{o._refreshHdas();var n=e.outputs[0];t.state("wait","Your job has been queued. You may close the browser window. The job will run in the background."),t.set("dataset_id_job",n.id),this.app.storage.save(),o._wait(t,i,s)}},function(e){var n="";e&&e.message&&e.message.data&&e.message.data.input&&(n=e.message.data.input+"."),t.state("failed","This visualization requires the 'charts' tool. Please make sure it is installed. "+n),s&&s()})},_wait:function(t,n,r){var i=this;e.request("GET",config.root+"api/datasets/"+t.get("dataset_id_job"),{},function(e){var s=!1;switch(e.state){case"ok":t.state("wait","Job completed successfully..."),n&&n(e),s=!0;break;case"error":t.state("failed","Job has failed. Please check the history for details."),r&&r(e),s=!0;break;case"running":t.state("wait","Your job is running. You may close the browser window. The job will continue in the background.")}s||setTimeout(function(){i._wait(t,n,r)},i.app.config.get("query_timeout"))})},_refreshHdas:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.refreshContents()}})}),define("plugin/library/datasets",["utils/utils"],function(e){return Backbone.Collection.extend({list:{},cache:{},initialize:function(t,n){this.app=t,this.options=e.merge(n,this.optionsDefault)},request:function(e,t,n){var r=this;e.groups?this._get_dataset(e.id,function(){r._get(e,t)}):this._get_dataset(e.id,t,n)},_get_dataset:function(t,n,r){var i=this.list[t];if(i){n(i);return}var s=this;e.request("GET",config.root+"api/datasets/"+t,{},function(e){switch(e.state){case"error":r&&r(e);break;default:s.list[t]=e,n(e)}})},_block_id:function(e,t){return e.id+"_"+e.start+"_"+e.end+"_"+t},_get:function(e,t){e.start||(e.start=0),e.end||(e.end=this.app.config.get("query_limit"));var n=[],r={},i=0;for(var s in e.groups){var o=e.groups[s];for(var u in o.columns){var a=o.columns[u].index,f=this._block_id(e,a);if(this.cache[f]||a==="auto")continue;!r[a]&&a!==undefined&&(r[a]=i,n.push(a),i++)}}if(n.length==0){this._fill_from_cache(e),t(e);return}var l={dataset_id:e.id,start:e.start,end:e.end,columns:n},c=this;this._fetch(l,function(r){for(var i in r){var s=n[i],o=c._block_id(e,s);c.cache[o]=r[i]}c._fill_from_cache(e),t(e)})},_fill_from_cache:function(e){console.debug("Datasets::_fill_from_cache() - Filling request from cache.");var t=e.start,n=0;for(var r in e.groups){var i=e.groups[r];for(var s in i.columns){var o=i.columns[s],u=this._block_id(e,o.index),a=this.cache[u];a&&(n=Math.max(n,a.length))}}n==0&&console.debug("FAILED - Datasets::_fill_from_cache() - Invalid range.");for(var r in e.groups){var i=e.groups[r];i.values=[];for(var f=0;f<n;f++)i.values[f]={x:parseInt(f)+t}}for(var r in e.groups){var i=e.groups[r];for(var s in i.columns){var o=i.columns[s];if(o.index=="auto")for(var f=0;f<n;f++){var l=i.values[f];l[s]=parseInt(f)+t}else{var u=this._block_id(e,o.index),a=this.cache[u];for(var f=0;f<n;f++){var l=i.values[f],c=a[f];isNaN(c)&&!o.is_label&&(c=0),l[s]=c}}}}},_fetch:function(t,n){var r=t.start?t.start:0,i=Math.abs(t.end-t.start),s=this.app.config.get("query_limit");if(!i||i>s)i=s;var o=0;t.columns&&(o=t.columns.length,console.debug("Datasets::_fetch() - Fetching "+o+" column(s)")),o==0&&console.debug("Datasets::_fetch() - No columns requested");var u="";for(var a in t.columns)u+=t.columns[a]+",";u=u.substring(0,u.length-1);var f=this;e.request("GET",config.root+"api/datasets/"+t.dataset_id,{data_type:"raw_data",provider:"dataset-column",limit:i,offset:r,indeces:u},function(e){var t=new Array(o);for(var r=0;r<o;r++)t[r]=[];for(var r in e.data){var i=e.data[r];for(var s in i){var u=i[s];u!==undefined&&u!=2147483647&&t[s].push(u)}}console.debug("Datasets::_fetch() - Fetching complete."),n(t)})}})}),define("plugin/models/group",[],function(){return Backbone.Model.extend({defaults:{key:"Data label",date:""},reset:function(){this.clear({silent:!0}).set(this.defaults),this.trigger("reset",this)}})}),define("plugin/models/groups",["plugin/models/group"],function(e){return Backbone.Collection.extend({model:e})}),define("plugin/library/deferred",["utils/utils"],function(e){return Backbone.Model.extend({queue:[],process:{},counter:0,initialize:function(){this.on("refresh",function(){if(this.counter==0)for(var e in this.queue){var t=this.queue[e];this.queue.splice(e,1),t()}})},execute:function(e){this.queue.push(e),this.trigger("refresh")},register:function(){var t=e.uuid();return this.process[t]=!0,this.counter++,console.debug("Deferred:register() - Registering "+t),t},done:function(e){this.process[e]&&(delete this.process[e],this.counter--,console.debug("Deferred:done() - Unregistering "+e),this.trigger("refresh"))},ready:function(){return this.counter==0}})});var Visualization=Backbone.Model.extend({defaults:{config:{}},urlRoot:function(){var e="/api/visualizations";return window.galaxy_config&&galaxy_config.root?galaxy_config.root+e:e},initialize:function(e){_.isObject(e.config)&&_.isObject(this.defaults.config)&&_.defaults(e.config,this.defaults.config),this._setUpListeners()},_setUpListeners:function(){},set:function(e,t){if(e==="config"){var n=this.get("config");_.isObject(n)&&(t=_.extend(_.clone(n),t))}return Backbone.Model.prototype.set.call(this,e,t),this},toString:function(){var e=this.get("id")||"";return this.get("title")&&(e+=":"+this.get("title")),"Visualization("+e+")"}}),VisualizationCollection=Backbone.Collection.extend({model:Visualization,url:function(){return galaxy_config.root+"api/visualizations"},initialize:function(e,t){t=t||{}},set:function(e,t){var n=this;e=_.map(e,function(e){var t=n.get(e.id);if(!t)return e;var r=t.toJSON();return _.extend(r,e),r}),Backbone.Collection.prototype.set.call(this,e,t)},toString:function(){return["VisualizationCollection(",[this.historyId,this.length].join(),")"].join("")}});define("mvc/visualization/visualization-model",function(){}),define("plugin/models/chart",["plugin/models/groups","plugin/library/deferred","mvc/visualization/visualization-model"],function(e,t){return Backbone.Model.extend({defaults:{id:null,title:"",type:"",date:null,state:"",state_info:"",modified:!1,dataset_id:"",dataset_id_job:""},initialize:function(n){this.groups=new e,this.settings=new Backbone.Model,this.deferred=new t},reset:function(){this.clear({silent:!0}).set(this.defaults),this.groups.reset(),this.settings.clear(),this.trigger("reset",this)},copy:function(e){var t=this;t.clear({silent:!0}).set(this.defaults),t.set(e.attributes),t.settings=e.settings.clone(),t.groups.reset(),e.groups.each(function(e){t.groups.add(e.clone())}),t.trigger("change",t)},state:function(e,t){this.set("state",e),this.set("state_info",t),this.trigger("set:state"),console.debug("Chart:state() - "+t+" ("+e+")")}})}),define("plugin/library/storage",["utils/utils","plugin/models/chart","plugin/models/group"],function(e,t,n){return Backbone.Model.extend({vis:null,initialize:function(e){this.app=e,this.chart=this.app.chart,this.options=this.app.options,this.id=this.options.id,this.vis=new Visualization({type:"charts",config:{dataset_id:this.options.config.dataset_id,chart_dict:{}}}),this.id&&(this.vis.id=this.id);var t=this.options.config.chart_dict;t&&(this.vis.get("config").chart_dict=t)},save:function(){var e=this.app.chart;this.vis.get("config").chart_dict={};var t=e.get("title");t!=""&&this.vis.set("title",t);var n={attributes:e.attributes,settings:e.settings.attributes,groups:[]};e.groups.each(function(e){n.groups.push(e.attributes)}),this.vis.get("config").chart_dict=n;var r=this;this.vis.save().fail(function(e,t,n){console.error(e,t,n)}).then(function(e){e&&e.id&&(r.id=e.id)})},load:function(){var e=this.vis.get("config").chart_dict;if(!e.attributes)return!1;this.chart.set(e.attributes),this.chart.state("ok","Loading saved visualization..."),this.chart.settings.set(e.settings);for(var t in e.groups)this.chart.groups.add(new n(e.groups[t]));return this.chart.set("modified",!1),!0}})}),define("plugin/library/screenshot",["libs/underscore"],function(e){function t(e,t,i){var s=new XMLSerializer,o="",u=this,a=0,f=0;return e.find("svg").each(function(){var e=$(this);n(e),a=parseInt(e.css("height")),f=parseInt(e.css("width")),e.attr({version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:f,height:a}),o+=s.serializeToString(this)}),r(e,t,{filename:i||"chart",type:"application/pdf",height:a,width:f,scale:2,svg:o}),o}function n(e){for(var t in document.styleSheets){var n=document.styleSheets[t],r=n.cssRules;if(r)for(var i=0,s=r.length;i<s;i++)try{e.find(r[i].selectorText).each(function(e,t){t.style.cssText+=r[i].style.cssText})}catch(o){}}}function r(e,t,n){var r=e.find("#viewport-form");r.length===0&&(r=$("<form>",{id:"viewport-form",method:"post",action:t,display:"none"}),e.append(r)),r.empty();for(name in n){var i=$("<input/>",{type:"hidden",name:name,value:n[name]});r.append(i)}try{r.submit()}catch(s){console.log(s)}}return{create:t}}),define("plugin/views/viewport",["mvc/ui/ui-portlet","plugin/library/ui","plugin/library/screenshot","utils/utils"],function(e,t,n,r){return Backbone.View.extend({container_list:[],canvas_list:[],initialize:function(e,t){this.app=e,this.chart=this.app.chart,this.options=r.merge(t,this.optionsDefault),this.setElement($(this._template())),this._fullscreen(this.$el,80),this._createContainer("div");var n=this;this.chart.on("redraw",function(){n._draw(n.chart)}),this.chart.on("set:state",function(){var e=n.$el.find("#info"),t=n.$el.find("container"),r=e.find("#icon");r.removeClass(),e.show(),e.find("#text").html(n.chart.get("state_info")),t.hide();var i=n.chart.get("state");switch(i){case"ok":e.hide(),t.show();break;case"failed":r.addClass("icon fa fa-warning");break;default:r.addClass("icon fa fa-spinner fa-spin")}})},show:function(){this.$el.show()},hide:function(){this.$el.hide()},_fullscreen:function(e,t){e.css("height",$(window).height()-t),$(window).resize(function(){e.css("height",$(window).height()-t)})},_createContainer:function(e,t){t=t||1;for(var n in this.container_list)this.container_list[n].remove();this.container_list=[],this.canvas_list=[];for(var n=0;n<t;n++){var r=$(this._templateContainer(e,parseInt(100/t)));this.$el.append(r),this.container_list[n]=r,e=="svg"?this.canvas_list[n]=d3.select(r.find("#canvas")[0]):this.canvas_list[n]=r.find("#canvas")}},_draw:function(e){var t=this,n=e.deferred.register(),r=e.get("type");this.chart_settings=this.app.types.get(r);var i=this.chart_settings.use_panels,s=1;i&&(s=e.groups.length),this._createContainer(this.chart_settings.tag,s),e.state("wait","Please wait...");if(!this.chart_settings.execute||this.chart_settings.execute&&e.get("modified"))this.app.jobs.cleanup(e),e.set("modified",!1);var t=this;require(["plugin/charts/"+r+"/wrapper"],function(r){var i=new r(t.app,{canvas:t.canvas_list});t.chart_settings.execute?t.app.jobs.request(e,t._defaultSettingsString(e),t._defaultRequestString(e),function(){i.draw(n,e,t._defaultRequestDictionary(e))},function(){e.deferred.done(n)}):i.draw(n,e,t._defaultRequestDictionary(e))})},_defaultRequestString:function(e){var t="",n=0,r=this;return e.groups.each(function(e){n++;for(var i in r.chart_settings.columns)t+=i+"_"+n+":"+(parseInt(e.get(i))+1)+", "}),t.substring(0,t.length-2)},_defaultSettingsString:function(e){var t="";for(key in e.settings.attributes)t+=key+":"+e.settings.get(key)+", ";return t.substring(0,t.length-2)},_defaultRequestDictionary:function(e){var t={groups:[]};this.chart_settings.execute?t.id=e.get("dataset_id_job"):t.id=e.get("dataset_id");var n=0,r=this;return e.groups.each(function(e){var i={};for(var s in r.chart_settings.columns){var o=r.chart_settings.columns[s];i[s]={index:e.get(s),is_label:o.is_label}}t.groups.push({key:++n+":"+e.get("key"),columns:i})}),t},_template:function(){return'<div class="charts-viewport"><div id="info" class="info"><span id="icon" class="icon" /><span id="text" class="text" /></div></div>'},_templateContainer:function(e,t){return'<div class="charts-viewport-container" style="width:'+t+'%;">'+'<div id="menu"/>'+"<"+e+' id="canvas" class="charts-viewport-canvas">'+"</div>"}})}),define("plugin/views/viewer",["utils/utils","plugin/library/ui","mvc/ui/ui-portlet","plugin/models/group","plugin/views/viewport","plugin/library/screenshot"],function(e,t,n,r,i,s){return Backbone.View.extend({initialize:function(e,r){this.app=e,this.chart=this.app.chart,this.viewport_view=new i(e);var o=this;this.portlet=new n.View({icon:"fa-bar-chart-o",title:"Viewport",operations:{edit_button:new t.ButtonIcon({icon:"fa-edit",tooltip:"Customize this chart",title:"Editor",onclick:function(){o._wait(o.chart,function(){o.app.go("editor")})}}),picture_button:new t.ButtonIcon({icon:"fa-camera",tooltip:"Download PDF-file ("+o.app.config.get("screenshot_url")+")",title:"Screenshot",onclick:function(){o._wait(o.chart,function(){s.create(o.viewport_view.$el,o.app.config.get("screenshot_url"),o.chart.get("title"))})}})}}),this.portlet.append(this.viewport_view.$el),this.setElement(this.portlet.$el);var o=this;this.chart.on("change:title",function(){o._refreshTitle()})},show:function(){this.$el.show(),$(window).trigger("resize")},hide:function(){this.$el.hide()},_refreshTitle:function(){var e=this.chart.get("title");this.portlet.title(e)},_wait:function(e,t){if(e.deferred.ready())t();else{var n=this;this.app.modal.show({title:"Please wait!",body:"Your chart is currently being processed. Please wait and try again.",buttons:{Close:function(){n.app.modal.hide()},Retry:function(){n.app.modal.hide(),setTimeout(function(){n._wait(e,t)},n.app.config.get("query_timeout"))}}})}}})}),define("mvc/ui/ui-tabs",["utils/utils"],function(e){var t=Backbone.View.extend({optionsDefault:{title_new:"",operations:null,onnew:null},initialize:function(t){this.visible=!1,this.$nav=null,this.$content=null,this.first_tab=null,this.options=e.merge(t,this.optionsDefault);var n=$(this._template(this.options));this.$nav=n.find(".tab-navigation"),this.$content=n.find(".tab-content"),this.setElement(n),this.list={};var r=this;this.options.operations&&$.each(this.options.operations,function(e,t){t.$el.prop("id",e),r.$nav.find(".operations").append(t.$el)});if(this.options.onnew){var i=$(this._template_tab_new(this.options));this.$nav.append(i),i.tooltip({title:"Add a new tab",placement:"bottom",container:r.$el}),i.on("click",function(e){i.tooltip("hide"),r.options.onnew()})}},add:function(e){var t=this,n=e.id,r=$(this._template_tab(e)),i=$(this._template_tab_content(e));this.list[n]=e.ondel?!0:!1,this.options.onnew?this.$nav.find("#new-tab").before(r):this.$nav.append(r),i.append(e.$el),this.$content.append(i),_.size(this.list)==1&&(r.addClass("active"),i.addClass("active"),this.first_tab=n);if(e.ondel){var s=r.find("#delete");s.tooltip({title:"Delete this tab",placement:"bottom",container:t.$el}),s.on("click",function(){return s.tooltip("destroy"),t.$el.find(".tooltip").remove(),e.ondel(),!1})}r.on("click",function(r){r.preventDefault(),e.onclick?e.onclick():t.show(n)})},del:function(e){this.$el.find("#tab-"+e).remove(),this.$el.find("#tab-content-"+e).remove(),this.first_tab==e&&(this.first_tab=null),this.first_tab!=null&&this.show(this.first_tab)},delRemovable:function(){for(var e in this.list)this.list[e]&&this.del(e)},show:function(e){this.$el.fadeIn("fast"),this.visible=!0,e&&(this.$el.find(".active").removeClass("active"),this.$el.find("#tab-"+e).addClass("active"),this.$el.find("#tab-content-"+e).addClass("active"))},hide:function(){this.$el.fadeOut("fast"),this.visible=!1},hideOperation:function(e){this.$nav.find("#"+e).hide()},showOperation:function(e){this.$nav.find("#"+e).show()},setOperation:function(e,t){var n=this.$nav.find("#"+e);n.off("click"),n.on("click",t)},title:function(e,t){var n=this.$el.find("#tab-title-text-"+e);return t&&n.html(t),n.html()},_template:function(e){return'<div class="ui-tabs tabbable tabs-left"><ul id="tab-navigation" class="tab-navigation nav nav-tabs"><div class="operations" style="float: right; margin-bottom: 4px;"></div></ul><div id="tab-content" class="tab-content"/></div>'},_template_tab_new:function(e){return'<li id="new-tab"><a href="javascript:void(0);"><i class="ui-tabs-add fa fa-plus-circle"/>'+e.title_new+"</a>"+"</li>"},_template_tab:function(e){var t='<li id="tab-'+e.id+'">'+'<a id="tab-title-link-'+e.id+'" title="" href="#tab-content-'+e.id+'" data-original-title="">'+'<span id="tab-title-text-'+e.id+'">'+e.title+"</span>";return e.ondel&&(t+='<i id="delete" class="ui-tabs-delete fa fa-minus-circle"/>'),t+="</a></li>",t},_template_tab_content:function(e){return'<div id="tab-content-'+e.id+'" class="tab-pane"/>'}});return{View:t}}),define("plugin/library/ui-table",["utils/utils"],function(e){var t=Backbone.View.extend({row:null,row_count:0,optionsDefault:{content:"No content available.",onchange:null,ondblclick:null,onconfirm:null,cls:"grid"},events:{click:"_onclick",dblclick:"_ondblclick"},initialize:function(t){this.options=e.merge(t,this.optionsDefault);var n=$(this._template(t));this.$thead=n.find("thead"),this.$tbody=n.find("tbody"),this.$tmessage=n.find("tmessage"),this.setElement(n),this.row=$("<tr></tr>")},addHeader:function(e){var t=$("<th></th>");t.append(e),this.row.append(t)},appendHeader:function(){this.$thead.append(this.row),this.row=$("<tr></tr>")},add:function(e,t,n){var r=$("<td></td>");t&&r.css("width",t),n&&r.css("text-align",n),r.append(e),this.row.append(r)},append:function(e){this._commit(e)},prepend:function(e){this._commit(e,!0)},get:function(e){return this.$el.find("#"+e)},del:function(e){var t=this.$tbody.find("#"+e);t.length>0&&(t.remove(),this.row_count--,this._refresh())},delAll:function(){this.$tbody.html(""),this.row_count=0,this._refresh()},value:function(e){this.before=this.$tbody.find(".current").attr("id"),e!==undefined&&(this.$tbody.find("tr").removeClass("current"),e&&this.$tbody.find("#"+e).addClass("current"));var t=this.$tbody.find(".current").attr("id");return t===undefined?null:(t!=this.before&&this.options.onchange&&this.options.onchange(e),t)},size:function(){return this.$tbody.find("tr").length},_commit:function(e,t){this.del(e),this.row.attr("id",e),t?this.$tbody.prepend(this.row):this.$tbody.append(this.row),this.row=$("<tr></tr>"),this.row_count++,this._refresh()},_onclick:function(e){var t=this.value(),n=$(e.target).closest("tr").attr("id");n!=""&&n&&t!=n&&(this.options.onconfirm?this.options.onconfirm(n):this.value(n))},_ondblclick:function(e){var t=this.value();t&&this.options.ondblclick&&this.options.ondblclick(t)},_refresh:function(){this.row_count==0?this.$tmessage.show():this.$tmessage.hide()},_template:function(e){return'<div><table class="'+e.cls+'">'+"<thead></thead>"+'<tbody style="cursor: pointer;"></tbody>'+"</table>"+"<tmessage>"+e.content+"</tmessage>"+"<div>"}});return{View:t}}),define("plugin/views/group",["plugin/library/ui-table","plugin/library/ui","utils/utils"],function(e,t,n){return Backbone.View.extend({initialize:function(r,i){this.app=r;var s=this;this.chart=this.app.chart,this.group=i.group,this.group_key=new t.Input({placeholder:"Data label",onchange:function(e){s.group.set("key",e)}}),this.table=new e.View({content:"No data column."});var o=$("<div/>");o.append(n.wrap((new t.Label({title:"Provide a label:"})).$el)),o.append(n.wrap(this.group_key.$el)),o.append(n.wrap((new t.Label({title:"Select columns:"})).$el)),o.append(n.wrap(this.table.$el)),this.setElement(o);var s=this;this.chart.on("change:dataset_id",function(){s._refreshTable()}),this.chart.on("change:type",function(){s._refreshTable()}),this.group.on("change:key",function(){s._refreshGroupKey()}),this.group.on("change",function(){s._refreshGroup()}),this._refreshTable(),this._refreshGroupKey(),this._refreshGroup()},_refreshTable:function(){var e=this.chart.get("dataset_id"),n=this.chart.get("type");if(!e||!n)return;var r=this,i=this.app.types.get(n);this.table.delAll();var s={};for(var o in i.columns){var u=i.columns[o];if(!u){console.debug("Group::_refreshTable() - Skipping column definition.");continue}var a=new t.Select.View({id:"select_"+o,wait:!0});this.table.add(u.title,"25%"),this.table.add(a.$el),this.table.append(o),s[o]=a}this.chart.state("wait","Loading metadata...");var f=this.chart.deferred.register();this.app.datasets.request({id:e},function(e){for(var t in s)r._addRow(t,e,s[t],i.columns[t]);r.chart.state("ok","Metadata initialized..."),r.chart.deferred.done(f)})},_addRow:function(e,t,n,r){var i=r.is_label,s=r.is_auto,o=[];s&&o.push({label:"Column: Row Number",value:"auto"});var u=t.metadata_column_types;for(var a in u)(!i&&(u[a]=="int"||u[a]=="float")||i)&&o.push({label:"Column: "+(parseInt(a)+1)+" ["+u[a]+"]",value:a});n.update(o),n.show();if(!n.exists(this.group.get(e))){var f=n.first();console.debug('Group()::_addRow() - Switching model value from "'+this.group.get(e)+'" to "'+f+'".'),this.group.set(e,f)}n.value(this.group.get(e));var l=this;n.setOnChange(function(t){l.group.set(e,t),l.chart.set("modified",!0)})},_refreshGroup:function(){this.group.set("date",n.time())},_refreshGroupKey:function(){var e=this.group.get("key");e===undefined&&(e=""),this.group_key.value(e)}})}),define("plugin/library/ui-table-form",["plugin/library/ui-table","plugin/library/ui","utils/utils"],function(e,t,n){var r=Backbone.View.extend({optionsDefault:{title:"",content:"",mode:""},list:[],initialize:function(r){this.table_title=new t.Label({title:r.title}),this.table=new e.View({content:r.content});var i=$("<div/>");i.append(n.wrap(this.table_title.$el)),i.append(n.wrap(this.table.$el)),this.setElement(i)},title:function(e){this.table_title.title(e)},update:function(e,t){this.table.delAll(),this.list=[];for(var n in e)this._add(n,e[n],t);for(var n in this.list)this.list[n].trigger("change")},_add:function(e,n,r){var i=this,s=null,o=n.type;switch(o){case"text":s=new t.Input({id:"field_"+e,placeholder:n.placeholder,value:r.get(e),onchange:function(t){r.set(e,t)}});break;case"select":s=new t.Select.View({id:"field_"+e,data:n.data,value:r.get(e),onchange:function(t){r.set(e,t);var s=_.findWhere(n.data,{value:t});if(s){for(var o in s.show){var u=s.show[o];i.table.get(u).show()}for(var o in s.hide){var u=s.hide[o];i.table.get(u).hide()}}}});break;case"separator":s=$("<div/>");break;default:console.log("ui-table-form:_add","Unknown setting type ("+n.type+")");return}if(o!="separator"){r.get(e)||r.set(e,n.init),s.value(r.get(e)),this.list[e]=s;var u=$("<div/>");u.append(s.$el),u.append('<div class="toolParamHelp" style="font-size: 0.9em;">'+n.info+"</div>"),this.table.add('<span style="white-space: nowrap;">'+n.title+"</span>","25%"),this.table.add(u)}else this.table.add('<h6 style="white-space: nowrap;">'+n.title+":<h6/>"),this.table.add($("<div/>"));this.table.append(e)}});return{View:r}}),define("plugin/views/settings",["plugin/library/ui","plugin/library/ui-table-form","utils/utils"],function(e,t,n){return Backbone.View.extend({initialize:function(e,n){this.app=e;var r=this;this.chart=this.app.chart,this.form=new t.View({title:"Chart options:",content:"This chart type does not provide any options."}),this.setElement(this.form.$el);var r=this;this.chart.on("change",function(){r._refreshTable()})},_refreshTable:function(){var e=this.chart.get("type");if(!e)return;var t=this.app.types.get(e);this.form.title(t.category+" - "+t.title+":"),this.form.update(t.settings,this.chart.settings)}})}),define("plugin/views/types",["utils/utils","plugin/library/ui"],function(e,t){return Backbone.View.extend({optionsDefault:{onchange:null,ondblclick:null},events:{click:"_onclick",dblclick:"_ondblclick"},initialize:function(t,n){this.app=t,this.options=e.merge(n,this.optionsDefault);var r=$('<div class="charts-grid"/>');this.setElement(r);var i={},s=t.types.attributes;for(var o in s){var u=s[o],a=u.category;i[a]||(i[a]={}),i[a][o]=u}for(var a in i){var r=$('<div style="clear: both;"/>');r.append(e.wrap(this._template_header({title:a})));for(var o in i[a]){var u=i[a][o];r.append(e.wrap(this._template_item({id:o,title:u.title,url:config.app_root+"charts/"+o+"/logo.png"})))}this.$el.append(e.wrap(r))}},value:function(e){var t=this.$el.find(".current").attr("id");e!==undefined&&(this.$el.find(".current").removeClass("current"),this.$el.find("#"+e).addClass("current"));var n=this.$el.find(".current").attr("id");return n===undefined?null:(n!=t&&this.options.onchange&&this.options.onchange(e),n)},_onclick:function(e){var t=this.value(),n=$(e.target).closest(".item").attr("id");n!=""&&n&&t!=n&&this.value(n)},_ondblclick:function(e){var t=this.value();t&&this.options.ondblclick&&this.options.ondblclick(t)},_template_header:function(e){return'<div class="header">• '+e.title+"<div>"},_template_item:function(e){return'<div id="'+e.id+'" class="item">'+'<img class="image" src="'+e.url+'">'+'<div class="title">'+e.title+"</div>"+"<div>"}})}),define("plugin/views/editor",["mvc/ui/ui-tabs","plugin/library/ui","mvc/ui/ui-portlet","utils/utils","plugin/models/chart","plugin/models/group","plugin/views/group","plugin/views/settings","plugin/views/types"],function(e,t,n,r,i,s,o,u,a){return Backbone.View.extend({optionsDefault:{header:!0,content:"No content available."},initialize:function(i,s){var o=this;this.app=i,this.chart=this.app.chart,this.options=r.merge(s,this.optionsDefault),this.portlet=new n.View({icon:"fa-bar-chart-o",title:"Editor",operations:{save:new t.ButtonIcon({icon:"fa-save",tooltip:"Draw Chart",title:"Draw",onclick:function(){o.app.go("viewer"),o._saveChart()}}),back:new t.ButtonIcon({icon:"fa-caret-left",tooltip:"Return to Viewer",title:"Return",onclick:function(){o.app.go("viewer"),o.app.storage.load()}})}}),this.types=new a(i,{onchange:function(e){o.chart.settings.clear(),o.chart.set({type:e}),o.chart.set("modified",!0)},ondblclick:function(e){o.app.go("viewer"),o._saveChart()}}),this.tabs=new e.View({title_new:"Add Data",onnew:function(){var e=o._addGroupModel();o.tabs.show(e.id)}}),this.title=new t.Input({placeholder:"Chart title",onchange:function(){o.chart.set("title",o.title.value())}});var f=$("<div/>");f.append(r.wrap((new t.Label({title:"Provide a chart title:"})).$el)),f.append(r.wrap(this.title.$el)),f.append(r.wrap((new t.Label({title:"Select a chart type:"})).$el)),f.append(r.wrap(this.types.$el)),this.tabs.add({id:"main",title:"Start",$el:f}),this.settings=new u(this.app),this.tabs.add({id:"settings",title:"Configuration",$el:this.settings.$el}),this.portlet.append(this.tabs.$el),this.setElement(this.portlet.$el),this.tabs.hideOperation("back");var o=this;this.chart.on("change:title",function(e){o._refreshTitle()}),this.chart.on("change:type",function(e){o.types.value(e.get("type"))}),this.chart.on("reset",function(e){o._resetChart()}),this.app.chart.on("redraw",function(e){o.portlet.showOperation("back")}),this.app.chart.groups.on("add",function(e){o._addGroup(e)}),this.app.chart.groups.on("remove",function(e){o._removeGroup(e)}),this.app.chart.groups.on("reset",function(e){o._removeAllGroups()}),this.app.chart.groups.on("change:key",function(e){o._refreshGroupKey()}),this._resetChart()},show:function(){this.$el.show()},hide:function(){this.$el.hide()},_refreshTitle:function(){var e=this.chart.get("title");this.portlet.title(e),this.title.value(e)},_refreshGroupKey:function(){var e=this,t=0;this.chart.groups.each(function(n){var r=n.get("key","");r==""&&(r="Chart data"),e.tabs.title(n.id,++t+": "+r)})},_addGroupModel:function(){var e=new s({id:r.uuid()});return this.chart.groups.add(e),e},_addGroup:function(e){var t=this,n=new o(this.app,{group:e}),r=t.chart.groups.length;this.tabs.add({id:e.id,$el:n.$el,ondel:function(){t.chart.groups.remove(e.id)}}),this._refreshGroupKey()},_removeGroup:function(e){this.tabs.del(e.id),this._refreshGroupKey(),this.chart.set("modified",!0)},_removeAllGroups:function(e){this.tabs.delRemovable()},_resetChart:function(){this.chart.set("id",r.uuid()),this.chart.set("type","nvd3_bar"),this.chart.set("dataset_id",this.app.options.config.dataset_id),this.chart.set("title","New Chart"),this.portlet.hideOperation("back")},_saveChart:function(){this.chart.set({type:this.types.value(),title:this.title.value(),date:r.time()}),this.chart.groups.length==0&&this._addGroupModel();var e=this;this.chart.deferred.execute(function(){e.app.storage.save(),e.chart.trigger("redraw")})}})}),define("plugin/models/config",[],function(){return Backbone.Model.extend({defaults:{query_limit:5e3,query_timeout:500,screenshot_url:"http://export.highcharts.com/"}})}),define("plugin/charts/nvd3/config",[],function(){return{title:"",category:"",library:"nvd3.js",tag:"svg",settings:{separator_label:{title:"X axis",type:"separator"},x_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"X-axis",placeholder:"Axis label"},x_axis_type:{title:"Axis value type",info:"Select the value type of the axis.",type:"select",init:"auto",data:[{label:"-- Do not show values --",value:"hide",hide:["x_axis_tick"]},{label:"Auto",value:"auto",hide:["x_axis_tick"]},{label:"Float",value:"f",show:["x_axis_tick"]},{label:"Exponent",value:"e",show:["x_axis_tick"]},{label:"Integer",value:"d",hide:["x_axis_tick"]},{label:"Percentage",value:"p",show:["x_axis_tick"]},{label:"Rounded",value:"r",show:["x_axis_tick"]},{label:"SI-prefix",value:"s",show:["x_axis_tick"]}]},x_axis_tick:{title:"Axis tick format",info:"Select the tick format for the axis.",type:"select",init:".1",data:[{label:"0.00001",value:".5"},{label:"0.0001",value:".4"},{label:"0.001",value:".3"},{label:"0.01",value:".2"},{label:"0.1",value:".1"},{label:"1",value:"1"}]},separator_tick:{title:"Y axis",type:"separator"},y_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"Y-axis",placeholder:"Axis label"},y_axis_type:{title:"Axis value type",info:"Select the value type of the axis.",type:"select",init:"auto",data:[{label:"-- Do not show values --",value:"hide",hide:["y_axis_tick"]},{label:"Auto",value:"auto",hide:["y_axis_tick"]},{label:"Float",value:"f",show:["y_axis_tick"]},{label:"Exponent",value:"e",show:["y_axis_tick"]},{label:"Integer",value:"d",hide:["y_axis_tick"]},{label:"Percentage",value:"p",show:["y_axis_tick"]},{label:"Rounded",value:"r",show:["y_axis_tick"]},{label:"SI-prefix",value:"s",show:["y_axis_tick"]}]},y_axis_tick:{title:"Axis tick format",info:"Select the tick format for the axis.",type:"select",init:".1",data:[{label:"0.00001",value:".5"},{label:"0.0001",value:".4"},{label:"0.001",value:".3"},{label:"0.01",value:".2"},{label:"0.1",value:".1"},{label:"1",value:"1"}]},separator_legend:{title:"Others",type:"separator"},show_legend:{title:"Show legend",info:"Would you like to add a legend?",type:"select",init:"true",data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]}}}}),define("plugin/charts/nvd3_bar/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Regular",category:"Bar diagrams",columns:{x:{title:"Values for x-axis",is_label:!0,is_auto:!0},y:{title:"Values for y-axis"}}})}),define("plugin/charts/nvd3_bar_stacked/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Stacked",category:"Bar diagrams",columns:{y:{title:"Values for y-axis"}}})}),define("plugin/charts/nvd3_bar_horizontal/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Horizontal",category:"Bar diagrams",columns:{x:{title:"Values for x-axis",is_label:!0,is_auto:!0},y:{title:"Values for y-axis"}},settings:{x_axis_type:{init:"hide"}}})}),define("plugin/charts/nvd3_bar_horizontal_stacked/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Stacked horizontal",category:"Bar diagrams",settings:{x_axis_type:{init:"hide"}},columns:{y:{title:"Values for y-axis"}}})}),define("plugin/charts/nvd3_histogram/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Histogram",category:"Data processing (requires 'charts' tool from Toolshed)",execute:"histogram",columns:{y:{title:"Observations"}},settings:{x_axis_label:{init:"Breaks"},y_axis_label:{init:"Density"},y_axis_type:{init:"f"},y_axis_tick:{init:".2"}}})}),define("plugin/charts/nvd3_histogram_discrete/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Histogram (discrete)",category:"Data processing (requires 'charts' tool from Toolshed)",execute:"histogramdiscrete",columns:{x:{title:"Observations",is_label:!0}},settings:{x_axis_label:{init:"Breaks"},y_axis_label:{init:"Density"},y_axis_type:{init:"f"},y_axis_tick:{init:".2"}}})}),define("plugin/charts/nvd3_line/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Line chart",category:"Others",columns:{y:{title:"Values for y-axis"}}})}),define("plugin/charts/nvd3_line_focus/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Line with focus",category:"Others",columns:{y:{title:"Values for y-axis"}}})}),define("plugin/charts/nvd3_pie/config",[],function(){return{title:"Pie chart",library:"nvd3.js",category:"Area charts",tag:"svg",use_panels:!0,columns:{label:{title:"Labels",is_label:!0,is_auto:!0},y:{title:"Values"}},settings:{show_legend:{title:"Show legend",info:"Would you like to add a legend?",type:"select",init:"false",data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]},donut_ratio:{title:"Donut ratio",info:"Determine how large the donut hole will be.",type:"select",init:"0.5",data:[{label:"50%",value:"0.5"},{label:"25%",value:"0.25"},{label:"10%",value:"0.10"},{label:"0%",value:"0"}]},label_separator:{type:"separator",title:"Label settings"},label_type:{title:"Donut label",info:"What would you like to show for each slice?",type:"select",init:"percent",data:[{label:"-- Nothing --",value:"hide",hide:"label_outside"},{label:"Label column",value:"key",show:"label_outside"},{label:"Value column",value:"value",show:"label_outside"},{label:"Percentage",value:"percent",show:"label_outside"}]},label_outside:{title:"Show outside",info:"Would you like to show labels outside the donut?",type:"select",init:"false",data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]}}}}),define("plugin/charts/nvd3_scatter/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Scatter plot",category:"Others",columns:{x:{title:"Values for x-axis"},y:{title:"Values for y-axis"}}})}),define("plugin/charts/nvd3_stackedarea/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Regular",category:"Area charts",columns:{y:{title:"Values for y-axis"}}})}),define("plugin/charts/nvd3_stackedarea_full/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Expanded",category:"Area charts",columns:{y:{title:"Values for y-axis"}}})}),define("plugin/charts/nvd3_stackedarea_stream/config",["plugin/charts/nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Stream",category:"Area charts",columns:{y:{title:"Values for y-axis"}}})}),define("plugin/charts/highcharts_boxplot/config",[],function(){return{title:"Box plot",category:"Data processing (requires 'charts' tool from Toolshed)",library:"highcharts.js",tag:"div",execute:"boxplot",columns:{y:{title:"Observations"}},settings:{separator_label:{title:"X axis",type:"separator"},x_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"X-axis",placeholder:"Axis label"},separator_tick:{title:"Y axis",type:"separator"},y_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"Y-axis",placeholder:"Axis label"}}}}),define("plugin/charts/heatmap/config",[],function(){return{title:"Heatmap",category:"Data processing (requires 'charts' tool from Toolshed)",library:"",tag:"div",use_panels:!0,execute:"heatmap",columns:{row_label:{title:"Row labels",is_label:!0},col_label:{title:"Column labels",is_label:!0},value:{title:"Observations"}},settings:{color_set:{title:"Color scheme",info:"Select a color scheme for your heatmap",type:"select",init:"ocean",data:[{label:"Cold-to-Hot",value:"hot"},{label:"Cool",value:"cool"},{label:"Copper",value:"copper"},{label:"Gebco",value:"gebco"},{label:"Globe",value:"globe"},{label:"Gray scale",value:"gray"},{label:"Haxby",value:"haxby"},{label:"Jet",value:"jet"},{label:"No-Green",value:"no_green"},{label:"Ocean",value:"ocean"},{label:"Polar",value:"polar"},{label:"Rainbow",value:"rainbow"},{label:"Red-to-Green",value:"redgreen"},{label:"Red-to-green (saturated)",value:"red2green"},{label:"Relief",value:"relief"},{label:"Seismograph",value:"seis"},{label:"Sealand",value:"sealand"},{label:"Split",value:"split"},{label:"Topo",value:"topo"},{label:"Wysiwyg",value:"wysiwyg"}]},sorting:{title:"Sorting",info:"How should the columns be clustered?",type:"select",init:"hclust",data:[{label:"Read from dataset",value:"hclust"},{label:"Sort column and row labels",value:"byboth"},{label:"Sort column labels",value:"bycolumns"},{label:"Sort by rows",value:"byrow"}]}},menu:function(){return{color_set:this.settings.color_set}}}}),define("plugin/charts/types",["plugin/charts/nvd3_bar/config","plugin/charts/nvd3_bar_stacked/config","plugin/charts/nvd3_bar_horizontal/config","plugin/charts/nvd3_bar_horizontal_stacked/config","plugin/charts/nvd3_histogram/config","plugin/charts/nvd3_histogram_discrete/config","plugin/charts/nvd3_line/config","plugin/charts/nvd3_line_focus/config","plugin/charts/nvd3_pie/config","plugin/charts/nvd3_scatter/config","plugin/charts/nvd3_stackedarea/config","plugin/charts/nvd3_stackedarea_full/config","plugin/charts/nvd3_stackedarea_stream/config","plugin/charts/highcharts_boxplot/config","plugin/charts/heatmap/config"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p,d){return Backbone.Model.extend({defaults:{nvd3_bar:e,nvd3_bar_stacked:t,nvd3_bar_horizontal:n,nvd3_bar_horizontal_stacked:r,nvd3_stackedarea:l,nvd3_stackedarea_full:c,nvd3_stackedarea_stream:h,nvd3_line:o,nvd3_line_focus:u,nvd3_scatter:f,nvd3_pie:a,nvd3_histogram:i,nvd3_histogram_discrete:s,highcharts_boxplot:p,heatmap:d}})}),define("plugin/app",["mvc/ui/ui-modal","mvc/ui/ui-portlet","plugin/library/ui","utils/utils","plugin/library/jobs","plugin/library/datasets","plugin/library/storage","plugin/views/viewer","plugin/views/editor","plugin/models/config","plugin/models/chart","plugin/charts/types"],function(e,t,n,r,i,s,o,u,a,f,l,c){return Backbone.View.extend({initialize:function(t){this.options=t,Galaxy&&Galaxy.modal?this.modal=Galaxy.modal:this.modal=new e.View,this.config=new f,this.types=new c,this.chart=new l,this.jobs=new i(this),this.datasets=new s(this),this.storage=new o(this),this.viewer_view=new u(this),this.editor_view=new a(this),this.$el.append(this.viewer_view.$el),this.$el.append(this.editor_view.$el);if(!this.storage.load())this.go("editor");else{this.go("viewer");var n=this;this.chart.deferred.execute(function(){n.chart.trigger("redraw")})}},go:function(e){$(".tooltip").hide();switch(e){case"editor":this.editor_view.show(),this.viewer_view.hide();break;case"viewer":this.editor_view.hide(),this.viewer_view.show()}},execute:function(e){},onunload:function(){},log:function(e,t){console.log(e+" "+t)}})});
\ No newline at end of file
+define("mvc/ui/ui-modal",[],function(){var e=Backbone.View.extend({elMain:"body",optionsDefault:{title:"ui-modal",body:"",backdrop:!0,height:null,width:null,closing_events:!1,closing_callback:null},buttonList:{},initialize:function(e){e&&this._create(e)},show:function(e){this.initialize(e),this.options.height?(this.$body.css("height",this.options.height),this.$body.css("overflow","hidden")):this.$body.css("max-height",$(window).height()/2),this.options.width&&this.$dialog.css("width",this.options.width),this.visible?this.$el.show():this.$el.fadeIn("fast"),this.visible=!0},hide:function(){this.visible=!1,this.$el.fadeOut("fast"),this.options.closing_callback&&this.options.closing_callback()},enableButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).prop("disabled",!1)},disableButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).prop("disabled",!0)},showButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).show()},hideButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).hide()},getButton:function(e){var t=this.buttonList[e];return this.$buttons.find("#"+t)},scrollTop:function(){return this.$body.scrollTop()},_create:function(e){var t=this;this.options=_.defaults(e,this.optionsDefault),this.options.body=="progress"&&(this.options.body=$('<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%"></div></div>')),this.$el&&(this.$el.remove(),$(document).off("keyup.ui-modal")),this.setElement(this._template(this.options.title)),this.$dialog=this.$el.find(".modal-dialog"),this.$body=this.$el.find(".modal-body"),this.$footer=this.$el.find(".modal-footer"),this.$buttons=this.$el.find(".buttons"),this.$backdrop=this.$el.find(".modal-backdrop"),this.$body.html(this.options.body),this.options.backdrop||this.$backdrop.removeClass("in");if(this.options.buttons){this.buttonList={};var n=0;$.each(this.options.buttons,function(e,r){var i="button-"+n++;t.$buttons.append($('<button id="'+i+'"></button>').text(e).click(r)).append(" "),t.buttonList[e]=i})}else this.$footer.hide();$(this.elMain).append($(this.el)),this.options.closing_events&&($(document).on("keyup.ui-modal",function(e){e.keyCode==27&&t.hide()}),this.$el.find(".modal-backdrop").on("click",function(){t.hide()}))},_template:function(e){return'<div class="modal"><div class="modal-backdrop fade in" style="z-index: -1;"></div><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" style="display: none;">×</button><h4 class="title">'+e+"</h4>"+"</div>"+'<div class="modal-body" style="position: static;"></div>'+'<div class="modal-footer">'+'<div class="buttons" style="float: right;"></div>'+"</div>"+"</div"+"</div>"+"</div>"}});return{View:e}}),function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.4.4";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else for(var o in e)if(x.has(e,o)&&t.call(r,e[o],o,e)===n)return};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r.push(t.call(n,e,i,s))}),r)};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?void 0:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},x.shuffle=function(e){var t,n=0,r=[];return T(e,function(e){t=x.random(n++),r[n-1]=r[t],r[t]=e}),r};var k=function(e){return x.isFunction(e)?e:function(t){return t[e]}};x.sortBy=function(e,t,n){var r=k(t);return x.pluck(x.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index<t.index?-1:1}),"value")};var L=function(e,t,n,r){var i={},s=k(t==null?x.identity:t);return T(e,function(t,o){var u=s.call(n,t,o,e);r(i,u,t)}),i};x.groupBy=function(e,t,n){return L(e,t,n,function(e,t,n){(x.has(e,t)?e[t]:e[t]=[]).push(n)})},x.countBy=function(e,t,n){return L(e,t,n,function(e,t){x.has(e,t)||(e[t]=0),e[t]++})},x.sortedIndex=function(e,t,n,r){n=n==null?x.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},x.toArray=function(e){return e?x.isArray(e)?u.call(e):e.length===+e.length?x.map(e,x.identity):x.values(e):[]},x.size=function(e){return e==null?0:e.length===+e.length?e.length:x.keys(e).length},x.first=x.head=x.take=function(e,t,n){return e==null?void 0:t!=null&&!n?u.call(e,0,t):e[0]},x.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},x.last=function(e,t,n){return e==null?void 0:t!=null&&!n?u.call(e,Math.max(e.length-t,0)):e[e.length-1]},x.rest=x.tail=x.drop=function(e,t,n){return u.call(e,t==null||n?1:t)},x.compact=function(e){return x.filter(e,x.identity)};var A=function(e,t,n){return T(e,function(e){x.isArray(e)?t?o.apply(n,e):A(e,t,n):n.push(e)}),n};x.flatten=function(e,t){return A(e,t,[])},x.without=function(e){return x.difference(e,u.call(arguments,1))},x.uniq=x.unique=function(e,t,n,r){x.isFunction(t)&&(r=n,n=t,t=!1);var i=n?x.map(e,n,r):e,s=[],o=[];return T(i,function(n,r){if(t?!r||o[o.length-1]!==n:!x.contains(o,n))o.push(n),s.push(e[r])}),s},x.union=function(){return x.uniq(a.apply(r,arguments))},x.intersection=function(e){var t=u.call(arguments,1);return x.filter(x.uniq(e),function(e){return x.every(t,function(t){return x.indexOf(t,e)>=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=u.call(arguments),t=x.max(x.pluck(e,"length")),n=new Array(t);for(var r=0;r<t;r++)n[r]=x.pluck(e,""+r);return n},x.unzip=function(e){var t=[];return x.each(e,function(e,n){x.each(e,function(e,r){t.length<=r&&(t[r]=[]),t[r][n]=e})}),t},x.object=function(e,t){if(e==null)return{};var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},x.indexOf=function(e,t,n){if(e==null)return-1;var r=0,i=e.length;if(n){if(typeof n!="number")return r=x.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(y&&e.indexOf===y)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},x.lastIndexOf=function(e,t,n){if(e==null)return-1;var r=n!=null;if(b&&e.lastIndexOf===b)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);var i=r?n:e.length;while(i--)if(e[i]===t)return i;return-1},x.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var O=function(){};x.bind=function(e,t){var n,r;if(e.bind===S&&S)return S.apply(e,u.call(arguments,1));if(!x.isFunction(e))throw new TypeError;return n=u.call(arguments,2),r=function(){if(this instanceof r){O.prototype=e.prototype;var i=new O;O.prototype=null;var s=e.apply(i,n.concat(u.call(arguments)));return Object(s)===s?s:i}return e.apply(t,n.concat(u.call(arguments)))}},x.partial=function(e){var t=u.call(arguments,1);return function(){return e.apply(this,t.concat(u.call(arguments)))}},x.bindAll=function(e){var t=u.call(arguments,1);if(t.length===0)throw new Error("bindAll must be passed function names");return T(t,function(t){e[t]=x.bind(e[t],e)}),e},x.memoize=function(e,t){var n={};return t||(t=x.identity),function(){var r=t.apply(this,arguments);return x.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},x.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=function(e){return x.delay.apply(x,[e,1].concat(u.call(arguments,1)))},x.throttle=function(e,t,n){var r,i,s,o,u=0,a=function(){u=new Date,s=null,o=e.apply(r,i)};return function(){var f=new Date;!u&&n===!1&&(u=f);var l=t-(f-u);return r=this,i=arguments,l<=0?(clearTimeout(s),s=null,u=f,o=e.apply(r,i)):s||(s=setTimeout(a,l)),o}},x.debounce=function(e,t,n){var r,i;return function(){var s=this,o=arguments,u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r;return clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},x.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},x.wrap=function(e,t){return function(){var n=[e];return o.apply(n,arguments),t.apply(this,n)}},x.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&t.push(n);return t},x.values=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push(e[n]);return t},x.pairs=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push([n,e[n]]);return t},x.invert=function(e){var t={};for(var n in e)x.has(e,n)&&(t[e[n]]=n);return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=M(e[o],t[o],n,r)))break}else{var a=e.constructor,l=t.constructor;if(a!==l&&!(x.isFunction(a)&&a instanceof a&&x.isFunction(l)&&l instanceof l))return!1;for(var c in e)if(x.has(e,c)){o++;if(!(u=x.has(t,c)&&M(e[c],t[c],n,r)))break}if(u){for(c in t)if(x.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};x.isEqual=function(e,t){return M(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(e);for(var i=0;i<e;i++)r[i]=t.call(n,i);return r},x.random=function(e,t){return t==null&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var _={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};_.unescape=x.invert(_.escape);var D={escape:new RegExp("["+x.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(_.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),x.result=function(e,t){if(e==null)return void 0;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(x,e))}})};var P=0;x.uniqueId=function(e){var t=++P+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(j,function(e){return"\\"+B[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var F=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("libs/underscore",function(e){return function(){var t,n;return t||e._}}(this)),define("utils/utils",["libs/underscore"],function(e){function t(e,t,r){n("GET",e,{},t,r)}function n(e,t,n,r,i){if(e=="GET"||e=="DELETE")t.indexOf("?")==-1?t+="?":t+="&",t+=$.param(n);var s=new XMLHttpRequest;s.open(e,t,!0),s.setRequestHeader("Accept","application/json"),s.setRequestHeader("Cache-Control","no-cache"),s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.setRequestHeader("Content-Type","application/json"),s.onloadend=function(){var e=s.status;try{response=jQuery.parseJSON(s.responseText)}catch(t){response=s.responseText}e==200?r&&r(response):i&&i(response)},e=="GET"||e=="DELETE"?s.send():s.send(JSON.stringify(n))}function r(e,t){var n=$('<div class="'+e+'"></div>');n.appendTo(":eq(0)");var r=n.css(t);return n.remove(),r}function i(e){$('link[href^="'+e+'"]').length||$('<link href="'+galaxy_config.root+e+'" rel="stylesheet">').appendTo("head")}function s(t,n){return t?e.defaults(t,n):n}function o(e,t){var n="";if(e>=1e11)e/=1e11,n="TB";else if(e>=1e8)e/=1e8,n="GB";else if(e>=1e5)e/=1e5,n="MB";else if(e>=100)e/=100,n="KB";else{if(!(e>0))return"<strong>-</strong>";e*=10,n="b"}var r=Math.round(e)/10;return t?r+" "+n:"<strong>"+r+"</strong> "+n}function u(){return(new Date).getTime().toString(36)}function a(e){var t=$("<p></p>");return t.append(e),t}function f(){var e=new Date,t=(e.getHours()<10?"0":"")+e.getHours(),n=(e.getMinutes()<10?"0":"")+e.getMinutes(),r=e.getDate()+"/"+(e.getMonth()+1)+"/"+e.getFullYear()+", "+t+":"+n;return r}return{cssLoadFile:i,cssGetAttribute:r,get:t,merge:s,bytesToString:o,uuid:u,time:f,wrap:a,request:n}}),define("mvc/ui/ui-portlet",["utils/utils"],function(e){var t=Backbone.View.extend({visible:!1,optionsDefault:{title:"",icon:"",buttons:null,body:null,scrollable:!0,nopadding:!1,operations:null,placement:"bottom"},$title:null,$content:null,$buttons:null,$operations:null,initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),this.$content=this.$el.find("#content"),this.$title=this.$el.find("#portlet-header-text"),this.options.scrollable||(this.options.title?this.$el.find("#portlet-content").addClass("no-scroll"):this.$el.find("#portlet-content").css("height","100%")),this.options.nopadding&&(this.$el.find("#portlet-content").css("padding","0px"),this.$el.find("#content").css("padding","0px")),this.$buttons=$(this.el).find("#buttons");if(this.options.buttons){var n=this;$.each(this.options.buttons,function(e,t){t.$el.prop("id",e),n.$buttons.append(t.$el)})}else this.$buttons.remove();this.$operations=$(this.el).find("#operations");if(this.options.operations){var n=this;$.each(this.options.operations,function(e,t){t.$el.prop("id",e),n.$operations.append(t.$el)})}this.options.body&&this.append(this.options.body)},append:function(t){this.$content.append(e.wrap(t))},content:function(){return this.$content},show:function(){this.$el.fadeIn("fast"),this.visible=!0},hide:function(){this.$el.fadeOut("fast"),this.visible=!1},enableButton:function(e){this.$buttons.find("#"+e).prop("disabled",!1)},disableButton:function(e){this.$buttons.find("#"+e).prop("disabled",!0)},hideOperation:function(e){this.$operations.find("#"+e).hide()},showOperation:function(e){this.$operations.find("#"+e).show()},setOperation:function(e,t){var n=this.$operations.find("#"+e);n.off("click"),n.on("click",t)},title:function(e){var t=this.$title;return e&&t.html(e),t.html()},_template:function(e){var t='<div class="ui-portlet">';return e.title&&(t+='<div id="portlet-header" class="portlet-header"><div id="operations" style="float: right;"></div><h3>',e.icon&&(t+='<i class="icon fa '+e.icon+'"> </i>'),t+='<span id="portlet-header-text">'+e.title+"</span>"+"</h3>"+"</div>"),t+='<div id="portlet-content" class="portlet-content">',e.placement=="top"&&(t+='<div id="buttons" class="buttons"></div>'),t+='<div id="content" class="content"></div>',e.placement=="bottom"&&(t+='<div id="buttons" class="buttons"></div>'),t+="</div></div>",t}});return{View:t}}),define("plugin/library/ui-select",["utils/utils"],function(e){var t=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:!0,wait:!1},selected:null,initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.selected=this.options.value,this.setElement(this._template(this.options)),this.$select=this.$el.find("#select"),this.$icon=this.$el.find("#icon");var n=this;this.$select.on("change",function(){n.value(n.$select.val())}),this.on("change",function(){n.options.onchange&&n.options.onchange(n.value())}),this._refresh(),this.options.visible||this.hide(),this.options.wait?this.wait():this.show()},value:function(e){var t=this.selected;e!==undefined&&(this.selected=e,this.$select.val(e));var n=this.selected;return n&&n!=t&&this.options.onchange&&this.options.onchange(n),n},first:function(){var e=this.$select.find("option");return e.length>0?e.val():undefined},text:function(){return this.$select.find("option:selected").text()},show:function(){this.$icon.removeClass(),this.$icon.addClass("fa fa-caret-down"),this.$select.show(),this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass(),this.$icon.addClass("fa fa-spinner fa-spin"),this.$select.hide()},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",!1)},disable:function(){this.$select.prop("disabled",!0)},add:function(e){this.$select.append(this._templateOption(e)),this._refresh()},del:function(e){this.$select.find("option[value="+e+"]").remove(),this.$select.trigger("change"),this._refresh()},update:function(e){this.$select.find("option").remove();for(var t in e)this.$select.append(this._templateOption(e[t]));this._refresh()},setOnChange:function(e){this.options.onchange=e},exists:function(e){return this.$select.find("option[value="+e+"]").length>0},_refresh:function(){this.$select.find("option[value=null]").remove();var e=this.$select.find("option").length;e==0?(this.disable(),this.$select.append(this._templateOption({value:"null",label:this.options.empty}))):this.enable(),this.selected&&this.$select.val(this.selected)},_templateOption:function(e){return'<option value="'+e.value+'">'+e.label+"</option>"},_template:function(e){var t='<div id="'+e.id+'" class="ui-select">'+'<div class="button">'+'<i id="icon"/>'+"</div>"+'<select id="select" class="select '+e.cls+" "+e.id+'">';for(key in e.data){var n=e.data[key],r="";if(n.value==e.value||n.value=="")r="selected";t+='<option value="'+n.value+'" '+r+">"+n.label+"</option>"}return t+="</select></div>",t}});return{View:t}}),define("plugin/library/ui",["utils/utils","plugin/library/ui-select","mvc/ui/ui-modal"],function(e,t,n){var r=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options))},_template:function(e){return'<img class="ui-image '+e.cls+'" src="'+e.url+'"/>'}}),i=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options))},title:function(e){this.$el.html(e)},_template:function(e){return'<label class="ui-label '+e.cls+'">'+e.title+"</label>"},value:function(){return options.title}}),s=Backbone.View.extend({optionsDefault:{id:null,title:"","float":"right",cls:"btn btn-default",icon:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",t.onclick),$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},_template:function(e){var t='<button id="'+e.id+'" type="submit" style="float: '+e.float+';" type="button" class="ui-button '+e.cls+'">';return e.icon&&(t+='<i class="icon fa '+e.icon+'"></i> '),t+=e.title+"</button>",t}}),o=Backbone.View.extend({optionsDefault:{"float":"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},_template:function(e){return'<div><span class="fa '+e.icon+'" class="ui-icon"/> '+e.title+"</div>"}}),u=Backbone.View.extend({optionsDefault:{title:"",id:null,"float":"right",cls:"icon-btn",icon:"",tooltip:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",t.onclick),$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},_template:function(e){var t="";e.title&&(t="width: auto;");var n='<div id="'+e.id+'" style="float: '+e.float+"; "+t+'" class="ui-button-icon '+e.cls+'">';return e.title?n+='<div class="button"><i class="icon fa '+e.icon+'"/> '+'<span class="title">'+e.title+"</span>"+"</div>":n+='<i class="icon fa '+e.icon+'"/>',n+="</div>",n}}),a=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",t.onclick)},_template:function(e){return'<div><a href="javascript:void(0)" class="ui-anchor '+e.cls+'">'+e.title+"</a></div>"}}),f=Backbone.View.extend({optionsDefault:{message:"",status:"info",persistent:!1},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement("<div></div>")},update:function(t){this.options=e.merge(t,this.optionsDefault);if(t.message!=""){this.$el.html(this._template(this.options)),this.$el.find(".alert").append(t.message),this.$el.fadeIn();if(!t.persistent){var n=this;window.setTimeout(function(){n.$el.is(":visible")?n.$el.fadeOut():n.$el.hide()},3e3)}}else this.$el.fadeOut()},_template:function(e){return'<div class="ui-message alert alert-'+e.status+'"/>'}}),l=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options));var n=this;this.options.onclick&&this.$el.on("submit",function(e){var t=n.$el.find("#search");n.options.onclick(t.val())})},_template:function(e){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+e.searchword+'">'+'<button type="submit" class="btn search-btn">'+'<i class="fa fa-search"></i>'+"</button>"+"</form>"+"</div>"}}),c=Backbone.View.extend({optionsDefault:{id:"",title:"",target:"",href:"",onunload:null,onclick:null,visible:!0,icon:null,tag:""},$menu:null,initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement($(this._template(this.options)));var n=$(this.el).find(".root"),r=this;n.on("click",function(e){e.preventDefault(),r.options.onclick&&r.options.onclick()}),this.options.visible||this.hide()},show:function(){$(this.el).show()},hide:function(){$(this.el).hide()},addMenu:function(t){var n={title:"",target:"",href:"",onclick:null,divider:!1,icon:null,cls:"button-menu btn-group"};n=e.merge(t,n),this.$menu||($(this.el).append(this._templateMenu()),this.$menu=$(this.el).find(".menu"));var r=$(this._templateMenuItem(n));r.on("click",function(e){e.preventDefault(),n.onclick&&n.onclick()}),this.$menu.append(r),n.divider&&this.$menu.append($(this._templateDivider()))},_templateMenuItem:function(e){var t='<li><a href="'+e.href+'" target="'+e.target+'">';return e.icon&&(t+='<i class="fa '+e.icon+'"></i>'),t+=" "+e.title+"</a>"+"</li>",t},_templateMenu:function(){return'<ul class="menu dropdown-menu pull-right" role="menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(e){var t='<div id="'+e.id+'" class="ui-button-menu '+e.cls+'">'+'<button type="button" class="root btn btn-default dropdown-toggle" data-toggle="dropdown">';return e.icon&&(t+='<i class="fa '+e.icon+'"></i>'),"</button></div>",t}}),h=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:!1,visible:!0,cls:"form-control"},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),this.options.disabled&&this.$el.prop("disabled",!0),this.options.visible||this.$el.hide();var n=this;this.$el.on("input",function(){n.options.onchange&&n.options.onchange(n.$el.val())})},value:function(e){return e!==undefined&&this.$el.val(e),this.$el.val()},_template:function(e){return'<input id="'+e.id+'" type="'+e.type+'" value="'+e.value+'" placeholder="'+e.placeholder+'" class="ui-input '+e.cls+'">'}}),p=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:!1,visible:!0,cls:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),this.options.disabled&&this.$el.prop("disabled",!0),this.options.visible||this.$el.hide();var n=this;this.$el.on("input",function(){n.options.onchange&&n.options.onchange(n.$el.val())})},value:function(e){return e!==undefined&&this.$el.val(e),this.$el.val()},_template:function(e){return'<textarea id="'+e.id+'" class="ui-textarea '+e.cls+'" rows="5"></textarea>'}});return{Label:i,Button:s,Icon:o,ButtonIcon:u,Input:h,Anchor:a,Message:f,Searchbox:l,Select:t,ButtonMenu:c,Modal:n,Textarea:p,Image:r}}),define("plugin/library/jobs",["utils/utils"],function(e){return Backbone.Model.extend({initialize:function(t,n){this.app=t,this.options=e.merge(n,this.optionsDefault)},request:function(e,t,n,r,i){var s=this;e.state("wait","Requesting job results...");var o=e.get("dataset_id_job");o!=""?s._wait(e,r,i):s._submit(e,t,n,r,i)},cleanup:function(t){var n=this,r=t.get("dataset_id_job");r!=""&&(e.request("PUT",config.root+"api/histories/none/contents/"+r,{deleted:!0},function(){n._refreshHdas()}),t.set("dataset_id_job",""))},_submit:function(t,n,r,i,s){var o=this,u=t.id,a=t.get("type"),f=this.app.types.get(a);data={tool_id:"charts",inputs:{input:{id:t.get("dataset_id"),src:"hda"},module:f.execute,columns:r,settings:n}},t.state("wait","Sending job request..."),e.request("POST",config.root+"api/tools",data,function(e){if(!e.outputs||e.outputs.length==0)t.state("failed","Job submission failed. No response."),s&&s();else{o._refreshHdas();var n=e.outputs[0];t.state("wait","Your job has been queued. You may close the browser window. The job will run in the background."),t.set("dataset_id_job",n.id),this.app.storage.save(),o._wait(t,i,s)}},function(e){var n="";e&&e.message&&e.message.data&&e.message.data.input&&(n=e.message.data.input+"."),t.state("failed","This visualization requires the 'charts' tool. Please make sure it is installed. "+n),s&&s()})},_wait:function(t,n,r){var i=this;e.request("GET",config.root+"api/datasets/"+t.get("dataset_id_job"),{},function(e){var s=!1;switch(e.state){case"ok":t.state("wait","Job completed successfully..."),n&&n(e),s=!0;break;case"error":t.state("failed","Job has failed. Please check the history for details."),r&&r(e),s=!0;break;case"running":t.state("wait","Your job is running. You may close the browser window. The job will continue in the background.")}s||setTimeout(function(){i._wait(t,n,r)},i.app.config.get("query_timeout"))})},_refreshHdas:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.refreshContents()}})}),define("plugin/library/datasets",["utils/utils"],function(e){return Backbone.Collection.extend({list:{},cache:{},initialize:function(t,n){this.app=t,this.options=e.merge(n,this.optionsDefault)},request:function(e,t,n){var r=this;e.groups?this._get_dataset(e.id,function(){r._get(e,t)}):this._get_dataset(e.id,t,n)},_get_dataset:function(t,n,r){var i=this.list[t];if(i){n(i);return}var s=this;e.request("GET",config.root+"api/datasets/"+t,{},function(e){switch(e.state){case"error":r&&r(e);break;default:s.list[t]=e,n(e)}})},_block_id:function(e,t){return e.id+"_"+e.start+"_"+e.end+"_"+t},_get:function(e,t){e.start||(e.start=0),e.end||(e.end=this.app.config.get("query_limit"));var n=[],r={},i=0;for(var s in e.groups){var o=e.groups[s];for(var u in o.columns){var a=o.columns[u].index,f=this._block_id(e,a);if(this.cache[f]||a==="auto")continue;!r[a]&&a!==undefined&&(r[a]=i,n.push(a),i++)}}if(n.length==0){this._fill_from_cache(e),t(e);return}var l={dataset_id:e.id,start:e.start,end:e.end,columns:n},c=this;this._fetch(l,function(r){for(var i in r){var s=n[i],o=c._block_id(e,s);c.cache[o]=r[i]}c._fill_from_cache(e),t(e)})},_fill_from_cache:function(e){console.debug("Datasets::_fill_from_cache() - Filling request from cache.");var t=e.start,n=0;for(var r in e.groups){var i=e.groups[r];for(var s in i.columns){var o=i.columns[s],u=this._block_id(e,o.index),a=this.cache[u];a&&(n=Math.max(n,a.length))}}n==0&&console.debug("FAILED - Datasets::_fill_from_cache() - Invalid range.");for(var r in e.groups){var i=e.groups[r];i.values=[];for(var f=0;f<n;f++)i.values[f]={x:parseInt(f)+t}}for(var r in e.groups){var i=e.groups[r];for(var s in i.columns){var o=i.columns[s];if(o.index=="auto")for(var f=0;f<n;f++){var l=i.values[f];l[s]=parseInt(f)+t}else{var u=this._block_id(e,o.index),a=this.cache[u];for(var f=0;f<n;f++){var l=i.values[f],c=a[f];isNaN(c)&&!o.is_label&&(c=0),l[s]=c}}}}},_fetch:function(t,n){var r=t.start?t.start:0,i=Math.abs(t.end-t.start),s=this.app.config.get("query_limit");if(!i||i>s)i=s;var o=0;t.columns&&(o=t.columns.length,console.debug("Datasets::_fetch() - Fetching "+o+" column(s)")),o==0&&console.debug("Datasets::_fetch() - No columns requested");var u="";for(var a in t.columns)u+=t.columns[a]+",";u=u.substring(0,u.length-1);var f=this;e.request("GET",config.root+"api/datasets/"+t.dataset_id,{data_type:"raw_data",provider:"dataset-column",limit:i,offset:r,indeces:u},function(e){var t=new Array(o);for(var r=0;r<o;r++)t[r]=[];for(var r in e.data){var i=e.data[r];for(var s in i){var u=i[s];u!==undefined&&u!=2147483647&&t[s].push(u)}}console.debug("Datasets::_fetch() - Fetching complete."),n(t)})}})}),define("plugin/models/group",[],function(){return Backbone.Model.extend({defaults:{key:"Data label",date:""},reset:function(){this.clear({silent:!0}).set(this.defaults),this.trigger("reset",this)}})}),define("plugin/models/groups",["plugin/models/group"],function(e){return Backbone.Collection.extend({model:e})}),define("plugin/library/deferred",["utils/utils"],function(e){return Backbone.Model.extend({queue:[],process:{},counter:0,initialize:function(){this.on("refresh",function(){for(var e in this.queue)if(this.counter==0){var t=this.queue[e];this.queue.splice(e,1),t()}})},execute:function(e){this.queue.push(e),this.trigger("refresh")},register:function(){var t=e.uuid();return this.process[t]=!0,this.counter++,console.debug("Deferred:register() - Registering "+t),t},done:function(e){this.process[e]&&(delete this.process[e],this.counter--,console.debug("Deferred:done() - Unregistering "+e),this.trigger("refresh"))},ready:function(){return this.counter==0}})});var Visualization=Backbone.Model.extend({defaults:{config:{}},urlRoot:function(){var e="/api/visualizations";return window.galaxy_config&&galaxy_config.root?galaxy_config.root+e:e},initialize:function(e){_.isObject(e.config)&&_.isObject(this.defaults.config)&&_.defaults(e.config,this.defaults.config),this._setUpListeners()},_setUpListeners:function(){},set:function(e,t){if(e==="config"){var n=this.get("config");_.isObject(n)&&(t=_.extend(_.clone(n),t))}return Backbone.Model.prototype.set.call(this,e,t),this},toString:function(){var e=this.get("id")||"";return this.get("title")&&(e+=":"+this.get("title")),"Visualization("+e+")"}}),VisualizationCollection=Backbone.Collection.extend({model:Visualization,url:function(){return galaxy_config.root+"api/visualizations"},initialize:function(e,t){t=t||{}},set:function(e,t){var n=this;e=_.map(e,function(e){var t=n.get(e.id);if(!t)return e;var r=t.toJSON();return _.extend(r,e),r}),Backbone.Collection.prototype.set.call(this,e,t)},toString:function(){return["VisualizationCollection(",[this.historyId,this.length].join(),")"].join("")}});define("mvc/visualization/visualization-model",function(){}),define("plugin/models/chart",["plugin/models/groups","plugin/library/deferred","mvc/visualization/visualization-model"],function(e,t){return Backbone.Model.extend({defaults:{id:null,title:"",type:"",date:null,state:"",state_info:"",modified:!1,dataset_id:"",dataset_id_job:""},initialize:function(n){this.groups=new e,this.settings=new Backbone.Model,this.deferred=new t},reset:function(){this.clear({silent:!0}).set(this.defaults),this.groups.reset(),this.settings.clear(),this.trigger("reset",this)},copy:function(e){var t=this;t.clear({silent:!0}).set(this.defaults),t.set(e.attributes),t.settings=e.settings.clone(),t.groups.reset(),e.groups.each(function(e){t.groups.add(e.clone())}),t.trigger("change",t)},state:function(e,t){this.set("state",e),this.set("state_info",t),this.trigger("set:state"),console.debug("Chart:state() - "+t+" ("+e+")")}})}),define("plugin/library/storage",["utils/utils","plugin/models/chart","plugin/models/group"],function(e,t,n){return Backbone.Model.extend({vis:null,initialize:function(e){this.app=e,this.chart=this.app.chart,this.options=this.app.options,this.id=this.options.id,this.vis=new Visualization({type:"charts",config:{dataset_id:this.options.config.dataset_id,chart_dict:{}}}),this.id&&(this.vis.id=this.id);var t=this.options.config.chart_dict;t&&(this.vis.get("config").chart_dict=t)},save:function(){var e=this.app.chart;this.vis.get("config").chart_dict={};var t=e.get("title");t!=""&&this.vis.set("title",t);var n={attributes:e.attributes,settings:e.settings.attributes,groups:[]};e.groups.each(function(e){n.groups.push(e.attributes)}),this.vis.get("config").chart_dict=n;var r=this;this.vis.save().fail(function(e,t,n){console.error(e,t,n)}).then(function(e){e&&e.id&&(r.id=e.id)})},load:function(){var e=this.vis.get("config").chart_dict;if(!e.attributes)return!1;var t=e.attributes.type;if(!t)return console.debug("Storage::load() - Chart type not provided. Invalid format."),!1;var r=this.app.types.get(t);if(!r)return console.debug("Storage::load() - Chart type not supported. Please re-configure the chart. Resetting chart."),!1;console.debug("Storage::load() - Loading chart type "+t+"."),this.chart.set(e.attributes),this.chart.state("ok","Loading saved visualization..."),this.chart.settings.set(e.settings);for(var i in e.groups)this.chart.groups.add(new n(e.groups[i]));return this.chart.set("modified",!1),!0}})}),define("plugin/library/screenshot",["libs/underscore"],function(e){function t(e,t,i){var s=new XMLSerializer,o="",u=this,a=0,f=0;return e.find("svg").each(function(){var e=$(this);n(e),a=parseInt(e.css("height")),f=parseInt(e.css("width")),e.attr({version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:f,height:a}),o+=s.serializeToString(this)}),r(e,t,{filename:i||"chart",type:"application/pdf",height:a,width:f,scale:2,svg:o}),o}function n(e){for(var t in document.styleSheets){var n=document.styleSheets[t],r=n.cssRules;if(r)for(var i=0,s=r.length;i<s;i++)try{e.find(r[i].selectorText).each(function(e,t){t.style.cssText+=r[i].style.cssText})}catch(o){}}}function r(e,t,n){var r=e.find("#viewport-form");r.length===0&&(r=$("<form>",{id:"viewport-form",method:"post",action:t,display:"none"}),e.append(r)),r.empty();for(name in n){var i=$("<input/>",{type:"hidden",name:name,value:n[name]});r.append(i)}try{r.submit()}catch(s){console.log(s)}}return{create:t}}),define("plugin/views/viewport",["mvc/ui/ui-portlet","plugin/library/ui","plugin/library/screenshot","utils/utils"],function(e,t,n,r){return Backbone.View.extend({container_list:[],canvas_list:[],initialize:function(e,t){this.app=e,this.chart=this.app.chart,this.options=r.merge(t,this.optionsDefault),this.setElement($(this._template())),this._fullscreen(this.$el,100),this._createContainer("div");var n=this;this.chart.on("redraw",function(){n._draw(n.chart)}),this.chart.on("set:state",function(){var e=n.$el.find("#info"),t=n.$el.find("container"),r=e.find("#icon");r.removeClass(),e.show(),e.find("#text").html(n.chart.get("state_info")),t.hide();var i=n.chart.get("state");switch(i){case"ok":e.hide(),t.show();break;case"failed":r.addClass("icon fa fa-warning");break;default:r.addClass("icon fa fa-spinner fa-spin")}})},show:function(){this.$el.show()},hide:function(){this.$el.hide()},_fullscreen:function(e,t){e.css("height",$(window).height()-t),$(window).resize(function(){e.css("height",$(window).height()-t)})},_createContainer:function(e,t){t=t||1;for(var n in this.container_list)this.container_list[n].remove();this.container_list=[],this.canvas_list=[];for(var n=0;n<t;n++){var r=$(this._templateContainer(e,parseInt(100/t)));this.$el.append(r),this.container_list[n]=r,e=="svg"?this.canvas_list[n]=d3.select(r.find("#canvas")[0]):this.canvas_list[n]=r.find("#canvas")}},_draw:function(e){var t=this,n=e.deferred.register(),r=e.get("type");this.chart_settings=this.app.types.get(r);var i=this.chart_settings.use_panels,s=1;i&&(s=e.groups.length),this._createContainer(this.chart_settings.tag,s),e.state("wait","Please wait...");if(!this.chart_settings.execute||this.chart_settings.execute&&e.get("modified"))this.app.jobs.cleanup(e),e.set("modified",!1);var t=this;require(["plugin/charts/"+this.app.chartPath(r)+"/wrapper"],function(r){var i=new r(t.app,{canvas:t.canvas_list});t.chart_settings.execute?t.app.jobs.request(e,t._defaultSettingsString(e),t._defaultRequestString(e),function(){i.draw(n,e,t._defaultRequestDictionary(e))},function(){e.deferred.done(n)}):i.draw(n,e,t._defaultRequestDictionary(e))})},_defaultRequestString:function(e){var t="",n=0,r=this;return e.groups.each(function(e){n++;for(var i in r.chart_settings.columns)t+=i+"_"+n+":"+(parseInt(e.get(i))+1)+", "}),t.substring(0,t.length-2)},_defaultSettingsString:function(e){var t="";for(key in e.settings.attributes)t+=key+":"+e.settings.get(key)+", ";return t.substring(0,t.length-2)},_defaultRequestDictionary:function(e){var t={groups:[]};this.chart_settings.execute?t.id=e.get("dataset_id_job"):t.id=e.get("dataset_id");var n=0,r=this;return e.groups.each(function(e){var i={};for(var s in r.chart_settings.columns){var o=r.chart_settings.columns[s];i[s]={index:e.get(s),is_label:o.is_label}}t.groups.push({key:++n+":"+e.get("key"),columns:i})}),t},_template:function(){return'<div class="charts-viewport"><div id="info" class="info"><span id="icon" class="icon" /><span id="text" class="text" /></div></div>'},_templateContainer:function(e,t){return'<div class="charts-viewport-container" style="width:'+t+'%;">'+'<div id="menu"/>'+"<"+e+' id="canvas" class="charts-viewport-canvas">'+"</div>"}})}),define("plugin/views/viewer",["utils/utils","plugin/library/ui","mvc/ui/ui-portlet","plugin/models/group","plugin/views/viewport","plugin/library/screenshot"],function(e,t,n,r,i,s){return Backbone.View.extend({initialize:function(e,r){this.app=e,this.chart=this.app.chart,this.viewport_view=new i(e);var o=this;this.portlet=new n.View({icon:"fa-bar-chart-o",title:"Viewport",scrollable:!1,operations:{edit_button:new t.ButtonIcon({icon:"fa-edit",tooltip:"Customize this chart",title:"Editor",onclick:function(){o._wait(o.chart,function(){o.app.go("editor")})}}),picture_button:new t.ButtonIcon({icon:"fa-camera",tooltip:"Download PDF-file ("+o.app.config.get("screenshot_url")+")",title:"Screenshot",onclick:function(){o._wait(o.chart,function(){s.create(o.viewport_view.$el,o.app.config.get("screenshot_url"),o.chart.get("title"))})}})}}),this.portlet.append(this.viewport_view.$el),this.setElement(this.portlet.$el);var o=this;this.chart.on("change:title",function(){o._refreshTitle()})},show:function(){this.$el.show(),$(window).trigger("resize")},hide:function(){this.$el.hide()},_refreshTitle:function(){var e=this.chart.get("title");this.portlet.title(e)},_wait:function(e,t){if(e.deferred.ready())t();else{var n=this;this.app.modal.show({title:"Please wait!",body:"Your chart is currently being processed. Please wait and try again.",buttons:{Close:function(){n.app.modal.hide()},Retry:function(){n.app.modal.hide(),setTimeout(function(){n._wait(e,t)},n.app.config.get("query_timeout"))}}})}}})}),define("mvc/ui/ui-tabs",["utils/utils"],function(e){var t=Backbone.View.extend({optionsDefault:{title_new:"",operations:null,onnew:null},initialize:function(t){this.visible=!1,this.$nav=null,this.$content=null,this.first_tab=null,this.options=e.merge(t,this.optionsDefault);var n=$(this._template(this.options));this.$nav=n.find(".tab-navigation"),this.$content=n.find(".tab-content"),this.setElement(n),this.list={};var r=this;this.options.operations&&$.each(this.options.operations,function(e,t){t.$el.prop("id",e),r.$nav.find(".operations").append(t.$el)});if(this.options.onnew){var i=$(this._template_tab_new(this.options));this.$nav.append(i),i.tooltip({title:"Add a new tab",placement:"bottom",container:r.$el}),i.on("click",function(e){i.tooltip("hide"),r.options.onnew()})}},add:function(e){var t=this,n=e.id,r=$(this._template_tab(e)),i=$(this._template_tab_content(e));this.list[n]=e.ondel?!0:!1,this.options.onnew?this.$nav.find("#new-tab").before(r):this.$nav.append(r),i.append(e.$el),this.$content.append(i),_.size(this.list)==1&&(r.addClass("active"),i.addClass("active"),this.first_tab=n);if(e.ondel){var s=r.find("#delete");s.tooltip({title:"Delete this tab",placement:"bottom",container:t.$el}),s.on("click",function(){return s.tooltip("destroy"),t.$el.find(".tooltip").remove(),e.ondel(),!1})}r.on("click",function(r){r.preventDefault(),e.onclick?e.onclick():t.show(n)})},del:function(e){this.$el.find("#tab-"+e).remove(),this.$el.find("#tab-content-"+e).remove(),this.first_tab==e&&(this.first_tab=null),this.first_tab!=null&&this.show(this.first_tab)},delRemovable:function(){for(var e in this.list)this.list[e]&&this.del(e)},show:function(e){this.$el.fadeIn("fast"),this.visible=!0,e&&(this.$el.find(".active").removeClass("active"),this.$el.find("#tab-"+e).addClass("active"),this.$el.find("#tab-content-"+e).addClass("active"))},hide:function(){this.$el.fadeOut("fast"),this.visible=!1},hideOperation:function(e){this.$nav.find("#"+e).hide()},showOperation:function(e){this.$nav.find("#"+e).show()},setOperation:function(e,t){var n=this.$nav.find("#"+e);n.off("click"),n.on("click",t)},title:function(e,t){var n=this.$el.find("#tab-title-text-"+e);return t&&n.html(t),n.html()},_template:function(e){return'<div class="ui-tabs tabbable tabs-left"><ul id="tab-navigation" class="tab-navigation nav nav-tabs"><div class="operations" style="float: right; margin-bottom: 4px;"></div></ul><div id="tab-content" class="tab-content"/></div>'},_template_tab_new:function(e){return'<li id="new-tab"><a href="javascript:void(0);"><i class="ui-tabs-add fa fa-plus-circle"/>'+e.title_new+"</a>"+"</li>"},_template_tab:function(e){var t='<li id="tab-'+e.id+'">'+'<a id="tab-title-link-'+e.id+'" title="" href="#tab-content-'+e.id+'" data-original-title="">'+'<span id="tab-title-text-'+e.id+'">'+e.title+"</span>";return e.ondel&&(t+='<i id="delete" class="ui-tabs-delete fa fa-minus-circle"/>'),t+="</a></li>",t},_template_tab_content:function(e){return'<div id="tab-content-'+e.id+'" class="tab-pane"/>'}});return{View:t}}),define("plugin/library/ui-table",["utils/utils"],function(e){var t=Backbone.View.extend({row:null,row_count:0,optionsDefault:{content:"No content available.",onchange:null,ondblclick:null,onconfirm:null,cls:"grid"},events:{click:"_onclick",dblclick:"_ondblclick"},initialize:function(t){this.options=e.merge(t,this.optionsDefault);var n=$(this._template(t));this.$thead=n.find("thead"),this.$tbody=n.find("tbody"),this.$tmessage=n.find("tmessage"),this.setElement(n),this.row=$("<tr></tr>")},addHeader:function(e){var t=$("<th></th>");t.append(e),this.row.append(t)},appendHeader:function(){this.$thead.append(this.row),this.row=$("<tr></tr>")},add:function(e,t,n){var r=$("<td></td>");t&&r.css("width",t),n&&r.css("text-align",n),r.append(e),this.row.append(r)},append:function(e){this._commit(e)},prepend:function(e){this._commit(e,!0)},get:function(e){return this.$el.find("#"+e)},del:function(e){var t=this.$tbody.find("#"+e);t.length>0&&(t.remove(),this.row_count--,this._refresh())},delAll:function(){this.$tbody.html(""),this.row_count=0,this._refresh()},value:function(e){this.before=this.$tbody.find(".current").attr("id"),e!==undefined&&(this.$tbody.find("tr").removeClass("current"),e&&this.$tbody.find("#"+e).addClass("current"));var t=this.$tbody.find(".current").attr("id");return t===undefined?null:(t!=this.before&&this.options.onchange&&this.options.onchange(e),t)},size:function(){return this.$tbody.find("tr").length},_commit:function(e,t){this.del(e),this.row.attr("id",e),t?this.$tbody.prepend(this.row):this.$tbody.append(this.row),this.row=$("<tr></tr>"),this.row_count++,this._refresh()},_onclick:function(e){var t=this.value(),n=$(e.target).closest("tr").attr("id");n!=""&&n&&t!=n&&(this.options.onconfirm?this.options.onconfirm(n):this.value(n))},_ondblclick:function(e){var t=this.value();t&&this.options.ondblclick&&this.options.ondblclick(t)},_refresh:function(){this.row_count==0?this.$tmessage.show():this.$tmessage.hide()},_template:function(e){return'<div><table class="'+e.cls+'">'+"<thead></thead>"+'<tbody style="cursor: pointer;"></tbody>'+"</table>"+"<tmessage>"+e.content+"</tmessage>"+"<div>"}});return{View:t}}),define("plugin/views/group",["plugin/library/ui-table","plugin/library/ui","utils/utils"],function(e,t,n){return Backbone.View.extend({initialize:function(r,i){this.app=r;var s=this;this.chart=this.app.chart,this.group=i.group,this.group_key=new t.Input({placeholder:"Data label",onchange:function(e){s.group.set("key",e)}}),this.table=new e.View({content:"No data column."});var o=$("<div/>");o.append(n.wrap((new t.Label({title:"Provide a label:"})).$el)),o.append(n.wrap(this.group_key.$el)),o.append(n.wrap((new t.Label({title:"Select columns:"})).$el)),o.append(n.wrap(this.table.$el)),this.setElement(o);var s=this;this.chart.on("change:dataset_id",function(){s._refreshTable()}),this.chart.on("change:type",function(){s._refreshTable()}),this.group.on("change:key",function(){s._refreshGroupKey()}),this.group.on("change",function(){s._refreshGroup()}),this._refreshTable(),this._refreshGroupKey(),this._refreshGroup()},_refreshTable:function(){var e=this.chart.get("dataset_id"),n=this.chart.get("type");if(!e||!n)return;var r=this,i=this.app.types.get(n);this.table.delAll();var s={};for(var o in i.columns){var u=i.columns[o];if(!u){console.debug("Group::_refreshTable() - Skipping column definition.");continue}var a=new t.Select.View({id:"select_"+o,wait:!0});this.table.add(u.title,"25%"),this.table.add(a.$el),this.table.append(o),s[o]=a}this.chart.state("wait","Loading metadata...");var f=this.chart.deferred.register();this.app.datasets.request({id:e},function(e){for(var t in s)r._addRow(t,e,s,i.columns[t]);r.chart.state("ok","Metadata initialized..."),r.chart.deferred.done(f)})},_addRow:function(e,t,n,r){var i=this,s=r.is_label,o=r.is_auto,u=r.is_numeric,a=r.is_unique,f=[],l=n[e];o&&f.push({label:"Column: Row Number",value:"auto"});var c=t.metadata_column_types;for(var h in c){var p=!1;c[h]=="int"||c[h]=="float"?p=u:p=s,p&&f.push({label:"Column: "+(parseInt(h)+1)+" ["+c[h]+"]",value:h})}l.update(f);if(!l.exists(this.group.get(e))){var d=l.first();console.debug('Group()::_addRow() - Switching model value from "'+this.group.get(e)+'" to "'+d+'".'),this.group.set(e,d)}l.value(this.group.get(e)),l.setOnChange(function(t){i.group.set(e,t),i.chart.set("modified",!0)}),l.show()},_refreshGroup:function(){this.group.set("date",n.time())},_refreshGroupKey:function(){var e=this.group.get("key");e===undefined&&(e=""),this.group_key.value(e)}})}),define("plugin/library/ui-table-form",["plugin/library/ui-table","plugin/library/ui","utils/utils"],function(e,t,n){var r=Backbone.View.extend({optionsDefault:{title:"",content:"",mode:""},list:[],initialize:function(r){this.table_title=new t.Label({title:r.title}),this.table=new e.View({content:r.content});var i=$("<div/>");i.append(n.wrap(this.table_title.$el)),i.append(n.wrap(this.table.$el)),this.setElement(i)},title:function(e){this.table_title.title(e)},update:function(e,t){this.table.delAll(),this.list=[];for(var n in e)this._add(n,e[n],t);for(var n in this.list)this.list[n].trigger("change")},_add:function(e,n,r){var i=this,s=null,o=n.type;switch(o){case"text":s=new t.Input({id:"field_"+e,placeholder:n.placeholder,value:r.get(e),onchange:function(t){r.set(e,t)}});break;case"select":s=new t.Select.View({id:"field_"+e,data:n.data,value:r.get(e),onchange:function(t){r.set(e,t);var s=_.findWhere(n.data,{value:t});if(s){for(var o in s.show){var u=s.show[o];i.table.get(u).show()}for(var o in s.hide){var u=s.hide[o];i.table.get(u).hide()}}}});break;case"separator":s=$("<div/>");break;default:console.log("ui-table-form:_add","Unknown setting type ("+n.type+")");return}if(o!="separator"){r.get(e)||r.set(e,n.init),s.value(r.get(e)),this.list[e]=s;var u=$("<div/>");u.append(s.$el),u.append('<div class="toolParamHelp" style="font-size: 0.9em;">'+n.info+"</div>"),this.table.add('<span style="white-space: nowrap;">'+n.title+"</span>","25%"),this.table.add(u)}else this.table.add('<h6 style="white-space: nowrap;">'+n.title+":<h6/>"),this.table.add($("<div/>"));this.table.append(e)}});return{View:r}}),define("plugin/views/settings",["plugin/library/ui","plugin/library/ui-table-form","utils/utils"],function(e,t,n){return Backbone.View.extend({initialize:function(e,n){this.app=e;var r=this;this.chart=this.app.chart,this.form=new t.View({title:"Chart options:",content:"This chart type does not provide any options."}),this.setElement(this.form.$el);var r=this;this.chart.on("change",function(){r._refresh()})},_refresh:function(){var e=this.chart.get("type");if(!e)return;var t=this.app.types.get(e);this.form.title(t.category+" - "+t.title+":"),this.form.update(t.settings,this.chart.settings)}})}),define("plugin/views/types",["utils/utils","plugin/library/ui"],function(e,t){return Backbone.View.extend({optionsDefault:{onchange:null,ondblclick:null},events:{click:"_onclick",dblclick:"_ondblclick"},initialize:function(t,n){var r=this;this.app=t,this.options=e.merge(n,this.optionsDefault);var i=$('<div class="charts-grid"/>');this.setElement(i);var s={},o=t.types.attributes;for(var u in o){var a=o[u],f=a.category;s[f]||(s[f]={}),s[f][u]=a}for(var f in s){var i=$('<div style="clear: both;"/>');i.append(e.wrap(this._template_header({title:f})));for(var u in s[f]){var a=s[f][u];i.append(e.wrap(this._template_item({id:u,title:a.title,url:config.app_root+"charts/"+r.app.chartPath(u)+"/logo.png"})))}this.$el.append(e.wrap(i))}},value:function(e){var t=this.$el.find(".current").attr("id");e!==undefined&&(this.$el.find(".current").removeClass("current"),this.$el.find("#"+e).addClass("current"));var n=this.$el.find(".current").attr("id");return n===undefined?null:(n!=t&&this.options.onchange&&this.options.onchange(e),n)},_onclick:function(e){var t=this.value(),n=$(e.target).closest(".item").attr("id");n!=""&&n&&t!=n&&this.value(n)},_ondblclick:function(e){var t=this.value();t&&this.options.ondblclick&&this.options.ondblclick(t)},_template_header:function(e){return'<div class="header">• '+e.title+"<div>"},_template_item:function(e){return'<div id="'+e.id+'" class="item">'+'<img class="image" src="'+e.url+'">'+'<div class="title">'+e.title+"</div>"+"<div>"}})}),define("plugin/views/editor",["mvc/ui/ui-tabs","plugin/library/ui","mvc/ui/ui-portlet","utils/utils","plugin/models/chart","plugin/models/group","plugin/views/group","plugin/views/settings","plugin/views/types"],function(e,t,n,r,i,s,o,u,a){return Backbone.View.extend({optionsDefault:{header:!0,content:"No content available."},initialize:function(i,s){var o=this;this.app=i,this.chart=this.app.chart,this.options=r.merge(s,this.optionsDefault),this.portlet=new n.View({icon:"fa-bar-chart-o",title:"Editor",operations:{save:new t.ButtonIcon({icon:"fa-save",tooltip:"Draw Chart",title:"Draw",onclick:function(){o.app.go("viewer"),o._saveChart()}}),back:new t.ButtonIcon({icon:"fa-caret-left",tooltip:"Return to Viewer",title:"Return",onclick:function(){o.app.go("viewer"),o.app.storage.load()}})}}),this.types=new a(i,{onchange:function(e){o.chart.settings.clear(),o.chart.set({type:e}),o.chart.set("modified",!0)},ondblclick:function(e){o.app.go("viewer"),o._saveChart()}}),this.tabs=new e.View({title_new:"Add Data",onnew:function(){var e=o._addGroupModel();o.tabs.show(e.id)}}),this.title=new t.Input({placeholder:"Chart title",onchange:function(){o.chart.set("title",o.title.value())}});var f=$("<div/>");f.append(r.wrap((new t.Label({title:"Provide a chart title:"})).$el)),f.append(r.wrap(this.title.$el)),f.append(r.wrap((new t.Label({title:"Select a chart type:"})).$el)),f.append(r.wrap(this.types.$el)),this.tabs.add({id:"main",title:"Start",$el:f}),this.settings=new u(this.app),this.tabs.add({id:"settings",title:"Configuration",$el:this.settings.$el}),this.portlet.append(this.tabs.$el),this.setElement(this.portlet.$el),this.tabs.hideOperation("back");var o=this;this.chart.on("change:title",function(e){o._refreshTitle()}),this.chart.on("change:type",function(e){o.types.value(e.get("type"))}),this.chart.on("reset",function(e){o._resetChart()}),this.app.chart.on("redraw",function(e){o.portlet.showOperation("back")}),this.app.chart.groups.on("add",function(e){o._addGroup(e)}),this.app.chart.groups.on("remove",function(e){o._removeGroup(e)}),this.app.chart.groups.on("reset",function(e){o._removeAllGroups()}),this.app.chart.groups.on("change:key",function(e){o._refreshGroupKey()}),this._resetChart()},show:function(){this.$el.show()},hide:function(){this.$el.hide()},_refreshTitle:function(){var e=this.chart.get("title");this.portlet.title(e),this.title.value(e)},_refreshGroupKey:function(){var e=this,t=0;this.chart.groups.each(function(n){var r=n.get("key","");r==""&&(r="Chart data"),e.tabs.title(n.id,++t+": "+r)})},_addGroupModel:function(){var e=new s({id:r.uuid()});return this.chart.groups.add(e),e},_addGroup:function(e){var t=this,n=new o(this.app,{group:e});this.tabs.add({id:e.id,$el:n.$el,ondel:function(){t.chart.groups.remove(e.id)}}),this._refreshGroupKey()},_removeGroup:function(e){this.tabs.del(e.id),this._refreshGroupKey(),this.chart.set("modified",!0)},_removeAllGroups:function(e){this.tabs.delRemovable()},_resetChart:function(){this.chart.set("id",r.uuid()),this.chart.set("type","nvd3_bar"),this.chart.set("dataset_id",this.app.options.config.dataset_id),this.chart.set("title","New Chart"),this.portlet.hideOperation("back")},_saveChart:function(){this.chart.set({type:this.types.value(),title:this.title.value(),date:r.time()}),this.chart.groups.length==0&&this._addGroupModel();var e=this;this.chart.deferred.execute(function(){e.app.storage.save(),e.chart.trigger("redraw")})}})}),define("plugin/models/config",[],function(){return Backbone.Model.extend({defaults:{query_limit:1e3,query_timeout:100,screenshot_url:"http://export.highcharts.com/"}})}),define("plugin/charts/nvd3/common/config",[],function(){return{title:"",category:"",library:"nvd3.js",tag:"svg",settings:{separator_label:{title:"X axis",type:"separator"},x_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"X-axis",placeholder:"Axis label"},x_axis_type:{title:"Axis value type",info:"Select the value type of the axis.",type:"select",init:"auto",data:[{label:"-- Do not show values --",value:"hide",hide:["x_axis_tick"]},{label:"Auto",value:"auto",hide:["x_axis_tick"]},{label:"Float",value:"f",show:["x_axis_tick"]},{label:"Exponent",value:"e",show:["x_axis_tick"]},{label:"Integer",value:"d",hide:["x_axis_tick"]},{label:"Percentage",value:"p",show:["x_axis_tick"]},{label:"Rounded",value:"r",show:["x_axis_tick"]},{label:"SI-prefix",value:"s",show:["x_axis_tick"]}]},x_axis_tick:{title:"Axis tick format",info:"Select the tick format for the axis.",type:"select",init:".1",data:[{label:"0.00001",value:".5"},{label:"0.0001",value:".4"},{label:"0.001",value:".3"},{label:"0.01",value:".2"},{label:"0.1",value:".1"},{label:"1",value:"1"}]},separator_tick:{title:"Y axis",type:"separator"},y_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"Y-axis",placeholder:"Axis label"},y_axis_type:{title:"Axis value type",info:"Select the value type of the axis.",type:"select",init:"auto",data:[{label:"-- Do not show values --",value:"hide",hide:["y_axis_tick"]},{label:"Auto",value:"auto",hide:["y_axis_tick"]},{label:"Float",value:"f",show:["y_axis_tick"]},{label:"Exponent",value:"e",show:["y_axis_tick"]},{label:"Integer",value:"d",hide:["y_axis_tick"]},{label:"Percentage",value:"p",show:["y_axis_tick"]},{label:"Rounded",value:"r",show:["y_axis_tick"]},{label:"SI-prefix",value:"s",show:["y_axis_tick"]}]},y_axis_tick:{title:"Axis tick format",info:"Select the tick format for the axis.",type:"select",init:".1",data:[{label:"0.00001",value:".5"},{label:"0.0001",value:".4"},{label:"0.001",value:".3"},{label:"0.01",value:".2"},{label:"0.1",value:".1"},{label:"1",value:"1"}]},separator_legend:{title:"Others",type:"separator"},show_legend:{title:"Show legend",info:"Would you like to add a legend?",type:"select",init:"true",data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]}}}}),define("plugin/charts/nvd3/bar/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Regular",category:"Bar diagrams",columns:{x:{title:"Values for x-axis",is_label:!0,is_auto:!0},y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/nvd3/bar_stacked/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Stacked",category:"Bar diagrams",columns:{y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/nvd3/bar_horizontal/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Horizontal",category:"Bar diagrams",columns:{x:{title:"Values for x-axis",is_label:!0,is_auto:!0},y:{title:"Values for y-axis",is_numeric:!0}},settings:{x_axis_type:{init:"hide"}}})}),define("plugin/charts/nvd3/bar_horizontal_stacked/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Stacked horizontal",category:"Bar diagrams",settings:{x_axis_type:{init:"hide"}},columns:{y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/nvd3/line_focus/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Line with focus",category:"Others",columns:{y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/nvd3/pie/config",[],function(){return $.extend(!0,{},{title:"Pie chart",category:"Area charts",tag:"svg",use_panels:!0,columns:{label:{title:"Labels",is_label:!0,is_auto:!0},y:{title:"Values",is_numeric:!0}},settings:{show_legend:{title:"Show legend",info:"Would you like to add a legend?",type:"select",init:"false",data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]},donut_ratio:{title:"Donut ratio",info:"Determine how large the donut hole will be.",type:"select",init:"0.5",data:[{label:"50%",value:"0.5"},{label:"25%",value:"0.25"},{label:"10%",value:"0.10"},{label:"0%",value:"0"}]},label_separator:{type:"separator",title:"Label settings"},label_type:{title:"Donut label",info:"What would you like to show for each slice?",type:"select",init:"percent",data:[{label:"-- Nothing --",value:"hide",hide:"label_outside"},{label:"Label column",value:"key",show:"label_outside"},{label:"Value column",value:"value",show:"label_outside"},{label:"Percentage",value:"percent",show:"label_outside"}]},label_outside:{title:"Show outside",info:"Would you like to show labels outside the donut?",type:"select",init:"false",data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]}}})}),define("plugin/charts/nvd3/stackedarea_full/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Expanded",category:"Area charts",columns:{y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/nvd3/stackedarea_stream/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Stream",category:"Area charts",columns:{y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/nvd3/histogram/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Histogram",category:"Data processing (requires 'charts' tool from Toolshed)",execute:"histogram",columns:{y:{title:"Observations",is_numeric:!0}},settings:{x_axis_label:{init:"Breaks"},y_axis_label:{init:"Density"},y_axis_type:{init:"f"},y_axis_tick:{init:".2"}}})}),define("plugin/charts/nvd3/histogram_discrete/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Histogram (discrete)",category:"Data processing (requires 'charts' tool from Toolshed)",execute:"histogramdiscrete",columns:{x:{title:"Observations",is_label:!0}},settings:{x_axis_label:{init:"Breaks"},y_axis_label:{init:"Density"},y_axis_type:{init:"f"},y_axis_tick:{init:".2"}}})}),define("plugin/charts/nvd3/line/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Line chart",category:"Others",columns:{y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/nvd3/scatter/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Scatter plot",category:"Others",columns:{x:{title:"Values for x-axis",is_numeric:!0},y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/nvd3/stackedarea/config",["plugin/charts/nvd3/common/config"],function(e){return $.extend(!0,{},e,{title:"Regular",category:"Area charts",columns:{y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/highcharts/common/config",[],function(){return{title:"",category:"",library:"highcharts",tag:"div",settings:{separator_label:{title:"X axis",type:"separator"},x_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"X-axis",placeholder:"Axis label"},x_axis_type:{title:"Axis value type",info:"Select the value type of the axis.",type:"select",init:"auto",data:[{label:"-- Do not show values --",value:"hide",hide:["x_axis_tick"]},{label:"Auto",value:"auto",hide:["x_axis_tick"]},{label:"Float",value:"f",show:["x_axis_tick"]},{label:"Exponent",value:"e",show:["x_axis_tick"]},{label:"Integer",value:"d",hide:["x_axis_tick"]},{label:"Percentage",value:"p",show:["x_axis_tick"]},{label:"Rounded",value:"r",show:["x_axis_tick"]},{label:"SI-prefix",value:"s",show:["x_axis_tick"]}]},x_axis_tick:{title:"Axis tick format",info:"Select the tick format for the axis.",type:"select",init:".1",data:[{label:"0.00001",value:".5"},{label:"0.0001",value:".4"},{label:"0.001",value:".3"},{label:"0.01",value:".2"},{label:"0.1",value:".1"},{label:"1",value:"1"}]},separator_tick:{title:"Y axis",type:"separator"},y_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"Y-axis",placeholder:"Axis label"},y_axis_type:{title:"Axis value type",info:"Select the value type of the axis.",type:"select",init:"auto",data:[{label:"-- Do not show values --",value:"hide",hide:["y_axis_tick"]},{label:"Auto",value:"auto",hide:["y_axis_tick"]},{label:"Float",value:"f",show:["y_axis_tick"]},{label:"Exponent",value:"e",show:["y_axis_tick"]},{label:"Integer",value:"d",hide:["y_axis_tick"]},{label:"Percentage",value:"p",show:["y_axis_tick"]},{label:"Rounded",value:"r",show:["y_axis_tick"]},{label:"SI-prefix",value:"s",show:["y_axis_tick"]}]},y_axis_tick:{title:"Axis tick format",info:"Select the tick format for the axis.",type:"select",init:".1",data:[{label:"0.00001",value:".5"},{label:"0.0001",value:".4"},{label:"0.001",value:".3"},{label:"0.01",value:".2"},{label:"0.1",value:".1"},{label:"1",value:"1"}]},separator_legend:{title:"Others",type:"separator"},legend_enabled:{title:"Show legend",info:"Would you like to add a legend?",type:"select",init:"true",data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]}}}}),define("plugin/charts/highcharts/bar/config",["plugin/charts/highcharts/common/config"],function(e){return $.extend(!0,{},e,{title:"Regular",category:"Bar diagrams",columns:{x:{title:"Values for x-axis",is_label:!0,is_auto:!0,is_unique:!0},y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/highcharts/bar_stacked/config",["plugin/charts/highcharts/common/config"],function(e){return $.extend(!0,{},e,{title:"Stacked",category:"Bar diagrams",columns:{x:{title:"Values for x-axis",is_label:!0,is_auto:!0},y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/highcharts/bar_horizontal/config",["plugin/charts/highcharts/common/config"],function(e){return $.extend(!0,{},e,{title:"Horizontal",category:"Bar diagrams",columns:{x:{title:"Values for x-axis",is_label:!0,is_auto:!0},y:{title:"Values for y-axis",is_numeric:!0}},settings:{x_axis_type:{init:"hide"}}})}),define("plugin/charts/highcharts/bar_horizontal_stacked/config",["plugin/charts/highcharts/common/config"],function(e){return $.extend(!0,{},e,{title:"Stacked horizontal",category:"Bar diagrams",settings:{x_axis_type:{init:"hide"}},columns:{x:{title:"Values for x-axis",is_label:!0,is_auto:!0},y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/highcharts/histogram/config",["plugin/charts/highcharts/common/config"],function(e){return $.extend(!0,{},e,{title:"Histogram",category:"Data processing (requires 'charts' tool from Toolshed)",execute:"histogram",columns:{y:{title:"Observations",is_numeric:!0}},settings:{x_axis_label:{init:"Breaks"},y_axis_label:{init:"Density"},y_axis_type:{init:"f"},y_axis_tick:{init:".2"}}})}),define("plugin/charts/highcharts/histogram_discrete/config",["plugin/charts/highcharts/common/config"],function(e){return $.extend(!0,{},e,{title:"Histogram (Discrete)",category:"Data processing (requires 'charts' tool from Toolshed)",execute:"histogramdiscrete",columns:{y:{title:"Observations",is_label:!0}},settings:{x_axis_label:{init:"Breaks"},y_axis_label:{init:"Density"},y_axis_type:{init:"f"},y_axis_tick:{init:".2"}}})}),define("plugin/charts/highcharts/line/config",["plugin/charts/highcharts/common/config"],function(e){return $.extend(!0,{},e,{title:"Line",category:"Others",columns:{x:{title:"Values for x-axis",is_label:!0,is_auto:!0,is_numeric:!1},y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/highcharts/pie/config",["plugin/charts/highcharts/common/config"],function(e){return $.extend(!0,{},e,{title:"Pie chart",category:"Area charts",use_panels:!0,columns:{label:{title:"Labels",is_label:!0,is_auto:!0},y:{title:"Values",is_numeric:!0}},settings:{show_legend:{title:"Show legend",info:"Would you like to add a legend?",type:"select",init:"false",data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]},donut_ratio:{title:"Donut ratio",info:"Determine how large the donut hole will be.",type:"select",init:"0.5",data:[{label:"50%",value:"0.5"},{label:"25%",value:"0.25"},{label:"10%",value:"0.10"},{label:"0%",value:"0"}]},label_separator:{type:"separator",title:"Label settings"},label_type:{title:"Donut label",info:"What would you like to show for each slice?",type:"select",init:"percent",data:[{label:"-- Nothing --",value:"hide",hide:"label_outside"},{label:"Label column",value:"key",show:"label_outside"},{label:"Value column",value:"value",show:"label_outside"},{label:"Percentage",value:"percent",show:"label_outside"}]},label_outside:{title:"Show outside",info:"Would you like to show labels outside the donut?",type:"select",init:"false",data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]}}})}),define("plugin/charts/highcharts/scatter/config",["plugin/charts/highcharts/common/config"],function(e){return $.extend(!0,{},e,{title:"Scatter plot",category:"Others",columns:{x:{title:"Values for x-axis",is_numeric:!0},y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/highcharts/stackedarea/config",["plugin/charts/highcharts/common/config"],function(e){return $.extend(!0,{},e,{title:"Regular",category:"Area charts",columns:{x:{title:"Values for x-axis",is_label:!0,is_auto:!0,is_numeric:!1},y:{title:"Values for y-axis",is_numeric:!0}}})}),define("plugin/charts/highcharts/boxplot/config",[],function(){return $.extend(!0,{},{title:"Box plot",category:"Data processing (requires 'charts' tool from Toolshed)",library:"highcharts.js",tag:"div",execute:"boxplot",columns:{y:{title:"Observations",is_numeric:!0}},settings:{separator_label:{title:"X axis",type:"separator"},x_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"X-axis",placeholder:"Axis label"},separator_tick:{title:"Y axis",type:"separator"},y_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"Y-axis",placeholder:"Axis label"}}})}),define("plugin/charts/highcharts/heatmap/config",["plugin/charts/highcharts/common/config"],function(e){return $.extend(!0,{},e,{title:"Heatmap",category:"Data processing (requires 'charts' tool from Toolshed)",execute:"heatmap",use_panels:!0,columns:{row_label:{title:"Row labels",is_label:!0},col_label:{title:"Column labels",is_label:!0},value:{title:"Observations",is_numeric:!0}}})}),define("plugin/charts/types",["plugin/charts/nvd3/bar/config","plugin/charts/nvd3/bar_stacked/config","plugin/charts/nvd3/bar_horizontal/config","plugin/charts/nvd3/bar_horizontal_stacked/config","plugin/charts/nvd3/line_focus/config","plugin/charts/nvd3/pie/config","plugin/charts/nvd3/stackedarea_full/config","plugin/charts/nvd3/stackedarea_stream/config","plugin/charts/nvd3/histogram/config","plugin/charts/nvd3/histogram_discrete/config","plugin/charts/nvd3/line/config","plugin/charts/nvd3/scatter/config","plugin/charts/nvd3/stackedarea/config","plugin/charts/highcharts/bar/config","plugin/charts/highcharts/bar_stacked/config","plugin/charts/highcharts/bar_horizontal/config","plugin/charts/highcharts/bar_horizontal_stacked/config","plugin/charts/highcharts/histogram/config","plugin/charts/highcharts/histogram_discrete/config","plugin/charts/highcharts/line/config","plugin/charts/highcharts/pie/config","plugin/charts/highcharts/scatter/config","plugin/charts/highcharts/stackedarea/config","plugin/charts/highcharts/boxplot/config","plugin/charts/highcharts/heatmap/config"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T){return Backbone.Model.extend({defaults:{nvd3_bar:e,nvd3_bar_stacked:t,nvd3_bar_horizontal:n,nvd3_bar_horizontal_stacked:r,nvd3_line_focus:i,nvd3_stackedarea_full:o,nvd3_stackedarea_stream:u,nvd3_pie:s,nvd3_stackedarea:h,nvd3_line:l,nvd3_scatter:c,nvd3_histogram:a,nvd3_histogram_discrete:f,highcharts_boxplot:x}})}),define("plugin/app",["mvc/ui/ui-modal","mvc/ui/ui-portlet","plugin/library/ui","utils/utils","plugin/library/jobs","plugin/library/datasets","plugin/library/storage","plugin/views/viewer","plugin/views/editor","plugin/models/config","plugin/models/chart","plugin/charts/types"],function(e,t,n,r,i,s,o,u,a,f,l,c){return Backbone.View.extend({initialize:function(t){this.options=t,Galaxy&&Galaxy.modal?this.modal=Galaxy.modal:this.modal=new e.View,this.config=new f,this.types=new c,this.chart=new l,this.jobs=new i(this),this.datasets=new s(this),this.storage=new o(this),this.viewer_view=new u(this),this.editor_view=new a(this),this.$el.append(this.viewer_view.$el),this.$el.append(this.editor_view.$el);if(!this.storage.load())this.go("editor");else{this.go("viewer");var n=this;this.chart.deferred.execute(function(){n.chart.trigger("redraw")})}},go:function(e){$(".tooltip").hide();switch(e){case"editor":this.editor_view.show(),this.viewer_view.hide();break;case"viewer":this.editor_view.hide(),this.viewer_view.show()}},chartPath:function(e){var t=e.split(/_(.+)/);return t.length>=2?t[0]+"/"+t[1]:(console.debug("FAILED App:chartPath() - Invalid format: "+e),undefined)},execute:function(e){},onunload:function(){},log:function(e,t){console.log(e+" "+t)}})});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/heatmap/config.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/config.js
+++ /dev/null
@@ -1,195 +0,0 @@
-define([], function() {
-
-return {
- title : 'Heatmap',
- category : 'Data processing (requires \'charts\' tool from Toolshed)',
- library : '',
- tag : 'div',
- use_panels : true,
- execute : 'heatmap',
-
- // columns
- columns : {
- row_label : {
- title : 'Row labels',
- is_label : true
- },
- col_label : {
- title : 'Column labels',
- is_label : true
- },
- value : {
- title : 'Observations'
- },
- },
-
- // settings
- settings: {
- /*limit : {
- title : 'Limit',
- info : 'Which to ranked clusters would you like to visualize',
- type : 'select',
- init : '20',
- data : [
- {
- label : '20',
- value : '20'
- },
- {
- label : '30',
- value : '30'
- },
- {
- label : '40',
- value : '40'
- },
- {
- label : '50',
- value : '50'
- },
- {
- label : '60',
- value : '60'
- },
- {
- label : '70',
- value : '70'
- },
- {
- label : '80',
- value : '80'
- },
- {
- label : '90',
- value : '90'
- },
- {
- label : '100',
- value : '100'
- }
- ]
- },*/
- color_set : {
- title : 'Color scheme',
- info : 'Select a color scheme for your heatmap',
- type : 'select',
- init : 'ocean',
- data : [
- {
- label : 'Cold-to-Hot',
- value : 'hot'
- },
- {
- label : 'Cool',
- value : 'cool'
- },
- {
- label : 'Copper',
- value : 'copper'
- },
- {
- label : 'Gebco',
- value : 'gebco'
- },
- {
- label : 'Globe',
- value : 'globe'
- },
- {
- label : 'Gray scale',
- value : 'gray'
- },
- {
- label : 'Haxby',
- value : 'haxby'
- },
- {
- label : 'Jet',
- value : 'jet'
- },
- {
- label : 'No-Green',
- value : 'no_green'
- },
- {
- label : 'Ocean',
- value : 'ocean'
- },
- {
- label : 'Polar',
- value : 'polar'
- },
- {
- label : 'Rainbow',
- value : 'rainbow'
- },
- {
- label : 'Red-to-Green',
- value : 'redgreen'
- },
- {
- label : 'Red-to-green (saturated)',
- value : 'red2green'
- },
- {
- label : 'Relief',
- value : 'relief'
- },
- {
- label : 'Seismograph',
- value : 'seis'
- },
- {
- label : 'Sealand',
- value : 'sealand'
- },
- {
- label : 'Split',
- value : 'split'
- },
- {
- label : 'Topo',
- value : 'topo'
- },
- {
- label : 'Wysiwyg',
- value : 'wysiwyg'
- }
- ]
- },
-
- sorting : {
- title : 'Sorting',
- info : 'How should the columns be clustered?',
- type : 'select',
- init : 'hclust',
- data : [
- {
- label : 'Read from dataset',
- value : 'hclust'
- },
- {
- label : 'Sort column and row labels',
- value : 'byboth'
- },
- {
- label : 'Sort column labels',
- value : 'bycolumns'
- },
- {
- label : 'Sort by rows',
- value : 'byrow'
- }
- ]
- }
- },
-
- // menu definition
- menu : function() {
- return {
- color_set : this.settings.color_set
- }
- }
-};
-
-});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/heatmap/heatmap-parameters.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-parameters.js
+++ /dev/null
@@ -1,52 +0,0 @@
-// dependencies
-define(['utils/utils', 'plugin/charts/heatmap/heatmap-plugin'], function(Utils, HeatmapPlugin) {
-
-// color palettes
-var colorSets = {
- seis: ['#AA0000', '#D00000', '#F70000', '#FF1D00', '#FF4400', '#FF6A00', '#FF9000', '#FFB700', '#FFDD00', '#FFFF00', '#FFFF00', '#FFFF00', '#BDFF0C', '#73FF1A', '#3FFA36', '#16F45A', '#00D08B', '#0087CD', '#0048FA', '#0024E3'],
-
- sealand: ['#8C66FF', '#6A66FF', '#6684FF', '#66A7FF', '#66CAFF', '#66ECFF', '#66FFF0', '#66FFCE', '#66FFAB', '#66FF88', '#66FF66', '#88FF66', '#ABFF66', '#CEFF66', '#FFEEA6', '#FFD3A6', '#FFB8A6', '#FFAAB0', '#FFB5CB', '#FFC0E1'],
-
- redgreen: ['#005824', '#1A693B', '#347B53', '#4F8D6B', '#699F83', '#83B09B', '#9EC2B3', '#B8D4CB', '#D2E6E3', '#EDF8FB', '#FFFFFF', '#F1EEF6', '#E6D3E1','#DBB9CD', '#D19EB9', '#C684A4', '#BB6990', '#B14F7C', '#A63467', '#9B1A53', '#91003F'],
-
- ocean: ['#000000', '#000209', '#000413', '#00061E', '#000728', '#000932', '#002650', '#00426E', '#005E8C', '#007AAA', '#0096C8', '#22A9C2', '#45BCBB', '#67CFB5', '#8AE2AE', '#ACF6A8', '#BCF8B9', '#CBF9CA', '#DBFBDC', '#EBFDED'],
-
- cool: ['#00FFFF', '#0DF2FF', '#19E6FF', '#26D9FF', '#33CCFF', '#3FBFFF', '#4CB3FF', '#59A6FF', '#6699FF', '#738CFF', '#7F7FFF', '#8C73FF', '#9966FF', '#A659FF', '#B24DFF', '#BF3FFF', '#CC33FF', '#D926FF', '#E619FF', '#F20DFF'],
-
- copper: ['#000000', '#100906', '#1F130D', '#301E13', '#40281A', '#50321F', '#603C26', '#70462D', '#805033', '#905A3A', '#A06440', '#B06E46', '#C0784D', '#D08253', '#E08C5A', '#F09660', '#FFA066', '#FFAA6D', '#FFB473', '#FFBE7A'],
-
- gebco: ['#00F0FF', '#00F0FF', '#00F0FF', '#23FFFF', '#23FFFF', '#23FFFF', '#5AFFFF', '#5AFFFF', '#5AFFFF', '#8CFFE6', '#8CFFE6', '#8CFFE6', '#A5FFD7', '#A5FFD7', '#A5FFD7', '#C3FFD7', '#C3FFD7', '#C3FFD7', '#D2FFD7', '#E6FFF0'],
-
- globe: ['#9900FF', '#9900FF', '#7722FF', '#5544FF', '#3366FF', '#1188FF', '#1BA4FF', '#51BAFF', '#86D0FF', '#BCE6FF', '#336600', '#F3CA89', '#D9A627', '#A49019', '#9F7B0D', '#996600', '#B27676', '#C2B0B0', '#E5E5E5', '#FFFFFF'],
-
- gray: ['#000000', '#0D0D0D', '#191919', '#262626', '#333333', '#3F3F3F', '#4C4C4C', '#595959', '#666666', '#737373', '#7F7F7F', '#8C8C8C', '#999999', '#A6A6A6', '#B2B2B2', '#BFBFBF', '#CCCCCC', '#D9D9D9', '#E6E6E6', '#F2F2F2'],
-
- haxby: ['#090079', '#280096', '#0009C8', '#0019D4', '#1A66F0', '#19AFFF', '#32BEFF', '#61E1F0', '#6AECE1', '#8AECAE', '#CDFFA2', '#DFF68D', '#F8D768', '#FFBD57', '#F4754B', '#FF5A5A', '#FF7C7C', '#F6B3AE', '#FFC4C4', '#FFECEC'],
-
- hot: ['#000000', '#220000', '#440000', '#660000', '#880000', '#AA0000', '#CC0000', '#EE0000', '#FF1100', '#FF3300', '#FF5500', '#FF7700', '#FF9900', '#FFBB00', '#FFDD00', '#FFFF00', '#FFFF33', '#FFFF66', '#FFFF99', '#FFFFCC'],
-
- jet: ['#00007F', '#0000B2', '#0000E5', '#0019FF', '#004DFF', '#007FFF', '#00B2FF', '#00E5FF', '#FFFFF2', '#FFFFD9', '#FFFFBF', '#FFFFA5', '#FFFF8C', '#FFE500', '#FFB300', '#FF7F00', '#FF4C00', '#FF1900', '#E50000', '#B20000'],
-
- no_green: ['#1F60FF', '#1F60FF', '#1F9FFF', '#1FBFFF', '#00CFFF', '#2AFFFF', '#2AFFFF', '#55FFFF', '#7FFFFF', '#AAFFFF', '#FFFF54', '#FFFF54', '#FFF000', '#FFBF00', '#FFA800', '#FF8A00', '#FF8A00', '#FF7000', '#FF4D00', '#FF0000'],
-
- polar: ['#0000FF', '#1919FF', '#3333FF', '#4C4CFF', '#6666FF', '#7F7FFF', '#9999FF', '#B2B2FF', '#CCCCFF', '#E6E6FF', '#FFFFFF', '#FFE5E5', '#FFCCCC', '#FFB2B2', '#FF9999', '#FF7F7F', '#FF6666', '#FF4C4C', '#FF3333', '#FF1A1A'],
-
- rainbow: ['#FF00FF', '#BF00FF', '#7F00FF', '#3F00FF', '#0000FF', '#003FFF', '#007FFF', '#00BFFF', '#00FFFF', '#00FFBF', '#00FF7F', '#00FF3F', '#00FF00', '#3FFF00', '#7FFF00', '#BFFF00', '#FFFF00', '#FFBF00', '#FF7F00', '#FF3F00'],
-
- red2green: ['#FF0000', '#FF1919', '#FF3333', '#FF4C4C', '#FF6666', '#FF7F7F', '#FF9999', '#FFB2B2', '#FFCCCC', '#FFE6E6', '#FFFFFF', '#E5FFE5', '#CCFFCC', '#B2FFB2', '#99FF99', '#7FFF7F', '#66FF66', '#4CFF4C', '#33FF33', '#1AFF1A'],
-
- relief: ['#000000', '#000413', '#000728', '#002650', '#005E8C', '#0096C8', '#45BCBB', '#8AE2AE', '#BCF8B9', '#DBFBDC', '#467832', '#887438', '#B19D48', '#DBC758', '#FAE769', '#FAEB7E', '#FCED93', '#FCF1A7', '#FCF6C1', '#FDFAE0'],
-
- split: ['#7F7FFF', '#6666E6', '#4D4DCC', '#3333B3', '#1A1A99', '#00007F', '#000066', '#00004D', '#000033', '#00001A', '#000000', '#1A0000', '#330000', '#4D0000', '#660000', '#7F0000', '#991A1A', '#B33333', '#CC4D4D', '#E66666'],
-
- topo: ['#C977D9', '#A18AE6', '#8AA2E6', '#8BD1E7', '#8AF3CF', '#85F38E', '#BDF385', '#EDE485', '#F0B086', '#DE9F8B', '#74A3B3', '#99CC70', '#DCD68E', '#EDDFAD', '#F7E8CA', '#FFF9F3', '#FFF9F6', '#FFFBF9', '#FFFCFA', '#FFFEFD'],
-
- wysiwyg: ['#3F003F', '#3F003F', '#3F00BF', '#003FFF', '#00A0FF', '#3FBFFF', '#3FBFFF', '#40E0FF', '#3FFFBF', '#3FFF3F', '#7FFF3F', '#BFFF3F', '#BFFF3F', '#FFE040', '#FFE040', '#FF6040', '#FF1F40', '#FF60C0', '#FFA0FF', '#FFA0FF']
-}
-
-// return
-return {
- colorSets: colorSets
-}
-
-});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
+++ /dev/null
@@ -1,740 +0,0 @@
-// dependencies
-define(['utils/utils'],
-function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // number of columns and rows
- colNumber: 0,
- rowNumber: 0,
-
- // indices
- rowIndex: [],
- colIndex: [],
-
- // labels
- rowLabel: [],
- colLabel: [],
-
- // cell size
- cellSize: 0,
-
- // font size
- fontSize: 0,
-
- // color buckets
- nColors: 0,
-
- // margins as cells
- margin : {
- top : 5,
- right : 5,
- bottom : 5,
- left : 5
- },
-
- // default settings
- optionsDefault: {
- title : '',
- pace : 1000,
- },
-
- // initialize
- initialize: function(options) {
- // link this
- var self = this;
-
- // load options
- this.options = Utils.merge(options, this.optionsDefault)
-
- // check requirements
- if (!this.options.data || !this.options.div || !this.options.colors) {
- console.debug('FAILED - HeatMapPlugin::initialize() - Parameters (container and/or data and/or colors) missing.');
- return;
- }
-
- // link data
- this.data = this.options.data;
-
- // set element
- this.setElement(this.options.div);
-
- //
- // data indexing
- //
-
- // labels (in alphabetical order)
- this.rowLabel = [];
- this.colLabel = [];
-
- // index (order from original dataset)
- this.rowIndex = [];
- this.colIndex = [];
-
- // unique keys (key indices are unique per label and indicate the labels rank in the alphabetical sorting)
- this.colRank = {};
- this.rowRank = {};
-
- //
- // identify and parse labels
- //
- for (var i in this.data) {
- var cell = this.data[i];
-
- // add label to index list
- var col_label = cell.col_label;
- if (this.colRank[col_label] === undefined) {
- this.colRank[col_label] = true;
- this.colLabel.push(col_label);
- this.colIndex.push(col_label);
- }
- var row_label = cell.row_label;
- if (this.rowRank[row_label] === undefined) {
- this.rowRank[row_label] = true;
- this.rowLabel.push(row_label);
- this.rowIndex.push(row_label);
- }
- }
-
- //
- // sort labels and update rank dictionary
- //
-
- // set sizes
- this.rowNumber = this.rowLabel.length
- this.colNumber = this.colLabel.length
-
- // sort labels alphabetical
- this.rowLabel.sort();
- this.colLabel.sort();
-
- // generate sorted key list for rows
- for (var i in this.rowLabel) {
- var row_label = this.rowLabel[i];
- var row = parseInt(i);
- this.rowRank[row_label] = row;
- }
-
- // generate sorted key list for columns
- for (var i in this.colLabel) {
- var col_label = this.colLabel[i];
- var col = parseInt(i);
- this.colRank[col_label] = col;
- }
-
- //
- // parse indexing from rank dictionary to cells
- //
-
- // min/max
- this.max = undefined;
- this.min = undefined
-
- // add indices to data
- for (var i in this.data) {
- // get cell data
- var cell = this.data[i];
-
- // add rank
- cell.col = this.colRank[cell.col_label];
- cell.row = this.rowRank[cell.row_label];
-
- // identify max/min values
- if (this.min == undefined || this.min > cell.value) {
- this.min = cell.value;
- }
- if (this.max == undefined || this.max < cell.value) {
- this.max = cell.value;
- }
- }
-
- //
- // translate original create cluster from order in original data
- //
-
- // generate sorted key list for columns
- for (var i in this.colIndex) {
- this.colIndex[i] = this.colRank[this.colIndex[i]];
- }
- // generate sorted key list for columns
- for (var i in this.rowIndex) {
- this.rowIndex[i] = this.rowRank[this.rowIndex[i]];
- }
-
- // middle
- this.mid = (this.max + this.min) / 2;
-
- //
- // set colors
- //
-
- // identify buckets
- this.nColors = this.options.colors.length;
-
- // color scale
- this.colorScale = d3.scale.quantile()
- .domain([this.min, this.mid, this.max])
- .range(this.options.colors);
-
- //
- // add ui elements
- //
- // create tooltip
- this.$tooltip = $(this._templateTooltip());
- this.$el.append(this.$tooltip);
-
- //
- // finally draw the heatmap
- //
- this._build();
-
- // catch window resize event
- $(window).resize(function () {
- self._build();
- });
- },
-
- _build: function() {
- // link this
- var self = this;
-
- // container (full draw area)
- this.widthContainer = this.$el.width();
- this.heightContainer = this.$el.height();
-
- // get grid dimensions
- this.width = this.widthContainer;
- this.height = this.heightContainer;
-
- // calculate cell size
- this.cellSize = Math.min(((this.height) / (this.rowNumber + this.margin.top + this.margin.bottom)),
- (this.width / (this.colNumber + this.margin.left + this.margin.right)));
-
- // set font size
- this.fontSize = Math.min(this.cellSize, 16);
-
- // set width/height for plugin
- this.width = this.cellSize * this.colNumber;
- this.height = this.cellSize * this.rowNumber;
-
- // get dimensions
- var margin = this.options.margin;
- var width = this.width;
- var height = this.height;
-
- // reset svg
- if (this.svg !== undefined) {
- this.$el.find('svg').remove();
- }
-
- // add main group and translate
- this.svg = d3.select(this.$el[0]).append('svg')
- .append('g')
- .attr('transform', 'translate(' + (this.widthContainer - width) / 2 + ',' +
- (this.heightContainer - height) / 2 + ')');
-
- // reset sorting
- this.rowSortOrder = false;
- this.colSortOrder = false;
-
- // build
- this.d3RowLabels = this._buildRowLabels();
- this.d3ColLabels = this._buildColLabels();
- this.d3HeatMap = this._buildHeatMap();
- this.d3Legend = this._buildLegend();
- this.d3Title = this._buildTitle();
- },
-
- // build title
- _buildTitle: function() {
- // link this
- var self = this;
-
- // gather data
- var height = this.height;
- var width = this.width;
- var cellSize = this.cellSize;
- var fontSize = this.fontSize;
- var title = this.options.title;
-
- // add title
- return this.svg.append('g')
- .append('text')
- .attr('x', width / 2)
- .attr('y', height + 3 * cellSize + fontSize + 3)
- .attr('text-anchor', 'middle')
- .text(title);
- },
-
- // build legend
- _buildLegend: function() {
- // link this
- var self = this;
-
- // gather data
- var cellSize = this.cellSize;
- var fontSize = this.fontSize;
- var height = this.height;
- var legendCellWidth = this.width / this.nColors;
-
- // create range labels
- var dataRange = [];
- for(var i = 0; i < this.nColors; i++) {
- dataRange.push('');
- }
-
- // prepare indices
- dataRangeFormat = d3.format('.3f');
- var dataRangeMin = 0;
- var dataRangeMid = '';
- var dataRangeMax = dataRange.length - 1;
-
- // add labels
- dataRange[dataRangeMin] = dataRangeFormat(this.min);
- dataRange[dataRangeMid] = this.mid;
- dataRange[dataRangeMax] = dataRangeFormat(this.max);
-
- // create legend
- var legend = this.svg.selectAll('.legend')
- .data(dataRange)
- .enter().append('g')
- .attr('class', 'legend');
-
- // add boxes
- legend.append('rect')
- .attr('x', function(d, i) {
- return legendCellWidth * i;
- })
- .attr('y', height + cellSize)
- .attr('width', legendCellWidth)
- .attr('height', cellSize)
- .style('fill', function(d, i) {
- return self.options.colors[i];
- });
-
- // add text
- legend.append('text')
- .attr('class', 'mono')
- .text(function(d) {
- return d;
- })
- .attr('width', legendCellWidth)
- .attr('x', function(d, i) {
- return legendCellWidth * i;
- })
- .attr('y', height + cellSize - 3)
- .style('font-size', fontSize + 'px');
-
- // return
- return legend;
- },
-
- // build column labels
- _buildColLabels: function() {
- // link this
- var self = this;
-
- // gather data
- var cellSize = this.cellSize;
- var fontSize = this.fontSize;
- var colIndex = this.colIndex;
- var colLabel = this.colLabel;
-
- // column labels
- var colLabels = this.svg.append('g')
- .selectAll('.colLabelg')
- .data(colLabel)
- .enter()
- .append('text')
- .text(function (d) {
- return d;
- })
- .attr('x', 0)
- .attr('y', function (d, i) {
- return colIndex.indexOf(i) * cellSize;
- })
- .style('font-size', fontSize + 'px')
- .style('text-anchor', 'left')
- .attr('transform', 'translate(' + cellSize / 2 + ', -17) rotate (-90)')
- .attr('class', function (d, i) {
- return 'colLabel mono c' + i;
- })
- .on('mouseover', function(d) {
- d3.select(this).classed('text-hover',true);
- })
- .on('mouseout' , function(d) {
- d3.select(this).classed('text-hover',false);
- })
- .on('click', function(d, i) {
- self.colSortOrder=!self.colSortOrder;
- self._sortByLabel('c', 'row', self.rowNumber, i, self.colSortOrder);
- d3.select('#order').property('selectedIndex', 4).node().focus();
- });
-
- // return
- return colLabels;
- },
-
- // build row labels
- _buildRowLabels: function() {
- // link this
- var self = this;
-
- // gather data
- var cellSize = this.cellSize;
- var fontSize = this.fontSize;
- var rowIndex = this.rowIndex;
- var rowLabel = this.rowLabel;
-
- // draw labels
- var rowLabels = this.svg.append('g')
- .selectAll('.rowLabelg')
- .data(rowLabel)
- .enter()
- .append('text')
- .text(function (d) {
- return d;
- })
- .attr('x', 0)
- .attr('y', function (d, i) {
- return rowIndex.indexOf(i) * cellSize;
- })
- .style('font-size', fontSize + 'px')
- .style('text-anchor', 'end')
- .attr('transform', 'translate(-10,' + cellSize / 1.5 + ')')
- .attr('class', function (d, i) {
- return 'rowLabel mono r' + i;
- } )
- .on('mouseover', function(d) {
- d3.select(this).classed('text-hover',true);
- })
- .on('mouseout' , function(d) {
- d3.select(this).classed('text-hover',false);
- })
- .on('click', function(d, i) {
- self.rowSortOrder=!self.rowSortOrder;
- self._sortByLabel('r', 'col', self.colNumber, i, self.rowSortOrder);
- d3.select('#order').property('selectedIndex', 4).node().focus();
- });
-
- // return
- return rowLabels;
- },
-
- // build heat map
- _buildHeatMap: function() {
- // link this
- var self = this;
-
- // gather data
- var cellSize = this.cellSize;
- var rowIndex = this.rowIndex;
- var rowLabel = this.rowLabel;
- var colIndex = this.colIndex;
- var colLabel = this.colLabel;
-
- // heat map
- var heatmap = this.svg.append('g').attr('class','g3')
- .selectAll('.cellg')
- .data(self.data, function(d) {
- return d.row + ':' + d.col;
- })
- .enter()
- .append('rect')
- .attr('x', function(d) {
- return colIndex.indexOf(d.col) * cellSize;
- })
- .attr('y', function(d) {
- return rowIndex.indexOf(d.row) * cellSize;
- })
- .attr('class', function(d){
- return 'cell cell-border cr' + d.row + ' cc' + d.col;
- })
- .attr('width', cellSize)
- .attr('height', cellSize)
- .style('fill', function(d) {
- return self.colorScale(d.value);
- })
- .on('mouseover', function(d){
- // highlight text
- d3.select(this).classed('cell-hover',true);
- d3.selectAll('.rowLabel').classed('text-highlight',function(r,ri){ return ri==(d.row);});
- d3.selectAll('.colLabel').classed('text-highlight',function(c,ci){ return ci==(d.col);});
-
- // update the tooltip position and value
- d3.select('#heatmap-tooltip')
- .style('left', (d3.event.pageX+10) + 'px')
- .style('top', (d3.event.pageY-10) + 'px')
- .select('#value')
- .text('Label: ' + rowLabel[d.row] + ' | ' + colLabel[d.col] + ', Value: ' + d.value);
- // show the tooltip
- d3.select('#heatmap-tooltip').classed('hidden', false);
- })
- .on('mouseout', function(){
- d3.select(this).classed('cell-hover',false);
- d3.selectAll('.rowLabel').classed('text-highlight',false);
- d3.selectAll('.colLabel').classed('text-highlight',false);
- d3.select('#heatmap-tooltip').classed('hidden', true);
- });
-
- // return
- return heatmap;
- },
-
- // change ordering of cells
- _sortByLabel: function(rORc, rowORcol, n, index, sortOrder) {
- // get cell size
- var cellSize = this.cellSize;
-
- // define transition / prepare element
- var t = this.svg.transition().duration(this.options.pace);
-
- // create cells
- var cells=[];
- for (var i = 0; i < n; i++) {
- cells[i] = {
- value: this.min - 1
- }
- cells[i][rowORcol] = i;
- }
-
- // collect cells
- t.selectAll('.c' + rORc + index).filter(function(ce) {
- cells[ce[rowORcol]].value = ce.value;
- });
-
- // sort cells
- cells.sort(function(a, b) {
- if (sortOrder) {
- return b.value - a.value;
- } else {
- return a.value - b.value;
- }
- });
-
- // get sorted key list
- var sorted = [];
- for (var i in cells) {
- sorted.push(cells[i][rowORcol]);
- }
-
- // rows or columns
- if(rORc == 'r') {
- // sort cells
- t.selectAll('.cell')
- .attr('x', function(d) {
- return sorted.indexOf(d.col) * cellSize;
- });
-
- // sort labels
- t.selectAll('.colLabel')
- .attr('y', function (d, i) {
- return sorted.indexOf(i) * cellSize;
- });
- } else {
- // sort cells
- t.selectAll('.cell')
- .attr('y', function(d) {
- return sorted.indexOf(d.row) * cellSize;
- });
-
- // sort labels
- t.selectAll('.rowLabel')
- .attr('y', function (d, i) {
- return sorted.indexOf(i) * cellSize;
- });
- }
- },
-
- // sort function
- _sortByOrder: function (value) {
- // link this
- var self = this;
-
- // gather data
- var cellSize = this.cellSize;
- var rowIndex = this.rowIndex;
- var rowLabel = this.rowLabel;
- var colIndex = this.colIndex;
- var colLabel = this.colLabel;
-
- // set duration / select element
- var t = this.svg.transition().duration(this.options.pace);
- if(value=='hclust'){
- t.selectAll('.cell')
- .attr('x', function(d) {
- return colIndex.indexOf(d.col) * cellSize;
- })
- .attr('y', function(d) {
- return rowIndex.indexOf(d.row) * cellSize;
- });
-
- t.selectAll('.rowLabel')
- .attr('y', function(d, i) {
- return rowIndex.indexOf(i) * cellSize;
- });
-
- t.selectAll('.colLabel')
- .attr('y', function(d, i) {
- return colIndex.indexOf(i) * cellSize;
- });
-
- } else if (value=='byboth') {
- t.selectAll('.cell')
- .attr('x', function(d) {
- return d.col * cellSize;
- })
- .attr('y', function(d) {
- return d.row * cellSize;
- });
-
- t.selectAll('.rowLabel')
- .attr('y', function (d, i) {
- return i * cellSize;
- });
-
- t.selectAll('.colLabel')
- .attr('y', function (d, i) {
- return i * cellSize;
- });
- } else if (value=='byrow') {
- t.selectAll('.cell')
- .attr('y', function(d) {
- return d.row * cellSize;
- });
-
- t.selectAll('.rowLabel')
- .attr('y', function (d, i) {
- return i * cellSize;
- });
- } else if (value=='bycol'){
- t.selectAll('.cell')
- .attr('x', function(d) {
- return d.col * cellSize;
- });
- t.selectAll('.colLabel')
- .attr('y', function (d, i) {
- return i * cellSize;
- });
- }
- },
-
- // selection of cells
- _addSelectionTool: function() {
- //
- // selection
- //
- var sa=d3.select('.g3')
- .on('mousedown', function() {
- if( !d3.event.altKey) {
- d3.selectAll('.cell-selected').classed('cell-selected', false);
- d3.selectAll('.rowLabel').classed('text-selected', false);
- d3.selectAll('.colLabel').classed('text-selected', false);
- }
- var p = d3.mouse(this);
- sa.append('rect')
- .attr({
- rx : 0,
- ry : 0,
- class : 'selection',
- x : p[0],
- y : p[1],
- width : 1,
- height : 1
- })
- })
- .on('mousemove', function() {
- var s = sa.select('rect.selection');
-
- if(!s.empty()) {
- var p = d3.mouse(this),
- d = {
- x : parseInt(s.attr('x'), 10),
- y : parseInt(s.attr('y'), 10),
- width : parseInt(s.attr('width'), 10),
- height : parseInt(s.attr('height'), 10)
- },
- move = {
- x : p[0] - d.x,
- y : p[1] - d.y
- };
-
- if(move.x < 1 || (move.x*2<d.width)) {
- d.x = p[0];
- d.width -= move.x;
- } else {
- d.width = move.x;
- }
-
- if(move.y < 1 || (move.y*2<d.height)) {
- d.y = p[1];
- d.height -= move.y;
- } else {
- d.height = move.y;
- }
- s.attr(d);
-
- // deselect all temporary selected state objects
- d3.selectAll('.cell-selection.cell-selected').classed('cell-selected', false);
- d3.selectAll('.text-selection.text-selected').classed('text-selected',false);
- d3.selectAll('.cell').filter(function(cell_d, i) {
- if(!d3.select(this).classed('cell-selected') &&
- // inner circle inside selection frame
- (this.x.baseVal.value)+cellSize >= d.x && (this.x.baseVal.value)<=d.x+d.width &&
- (this.y.baseVal.value)+cellSize >= d.y && (this.y.baseVal.value)<=d.y+d.height)
- {
- d3.select(this)
- .classed('cell-selection', true)
- .classed('cell-selected', true);
-
- d3.select('.r' + cell_d.row)
- .classed('text-selection',true)
- .classed('text-selected',true);
-
- d3.select('.c' + cell_d.col)
- .classed('text-selection',true)
- .classed('text-selected',true);
- }
- });
- }
- })
- .on('mouseup', function() {
- // remove selection frame
- sa.selectAll('rect.selection').remove();
-
- // remove temporary selection marker class
- d3.selectAll('.cell-selection').classed('cell-selection', false);
- d3.selectAll('.text-selection').classed('text-selection', false);
- })
- .on('mouseout', function() {
- if(d3.event.relatedTarget.tagName=='html') {
- // remove selection frame
- sa.selectAll('rect.selection').remove();
-
- // remove temporary selection marker class
- d3.selectAll('.cell-selection').classed('cell-selection', false);
- d3.selectAll('.rowLabel').classed('text-selected',false);
- d3.selectAll('.colLabel').classed('text-selected',false);
- }
- });
- },
-
- // template
- _templateSelect: function() {
- return '<select id="order">' +
- '<option value="hclust">Cluster</option>' +
- '<option value="byboth">Sort by row and column</option>' +
- '<option value="byrow">Sort by row label</option>' +
- '<option value="bycol">Sort by column label</option>' +
- '</select>';
- },
-
- // template
- _templateTooltip: function() {
- return '<div id="heatmap-tooltip" class="hidden">' +
- '<p><span id="value"></p>'
- '</div>';
- }
-});
-});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/heatmap/logo.png
Binary file config/plugins/visualizations/charts/static/charts/heatmap/logo.png has changed
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/heatmap/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/wrapper.js
+++ /dev/null
@@ -1,86 +0,0 @@
-// dependencies
-define(['utils/utils', 'plugin/charts/heatmap/heatmap-plugin', 'plugin/charts/heatmap/heatmap-parameters'],
-function(Utils, HeatmapPlugin, HeatmapParameters) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- },
-
- // render
- draw : function(process_id, chart, request_dictionary)
- {
- // link this
- var self = this;
-
- // loop through data groups
- var index = 0;
- for (var group_index in request_dictionary.groups) {
-
- // configure request
- var tmp_dict = {
- id : request_dictionary.id,
- groups : [{
- key : request_dictionary.groups[group_index].key,
- columns : {
- row_label: {
- index : index++,
- is_label : true
- },
- col_label: {
- index : index++,
- is_label : true
- },
- value: {
- index : index++
- }
- }
- }]
- };
-
- // target div
- var group_div = self.options.canvas[group_index];
-
- // draw group
- this._draw_group(group_index, group_div, chart, tmp_dict, function(group_index) {
- if (group_index == request_dictionary.groups.length - 1) {
- // set chart state
- chart.state('ok', 'Heat map drawn.');
-
- // unregister process
- chart.deferred.done(process_id);
- }
- });
- }
- },
-
- // draw group
- _draw_group: function(group_index, div, chart, request_dictionary, callback) {
- // link this
- var self = this;
-
- // request data
- this.app.datasets.request(request_dictionary, function() {
-
- // get group
- var group = request_dictionary.groups[0];
-
- // draw plot
- var heatmap = new HeatmapPlugin({
- 'title' : group.key,
- 'colors' : HeatmapParameters.colorSets[chart.settings.get('color_set')],
- 'data' : group.values,
- 'div' : div
- });
-
- // callback on completion
- callback (group_index);
- });
- }
-});
-
-});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/bar/config.js
@@ -0,0 +1,20 @@
+define(['plugin/charts/highcharts/common/config'], function(config) {
+
+return $.extend(true, {}, config, {
+ title : 'Regular',
+ category : 'Bar diagrams',
+ columns : {
+ x : {
+ title : 'Values for x-axis',
+ is_label : true,
+ is_auto : true,
+ is_unique : true
+ },
+ y : {
+ title : 'Values for y-axis',
+ is_numeric : true
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar/logo.png
Binary file config/plugins/visualizations/charts/static/charts/highcharts/bar/logo.png has changed
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar/wrapper.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/bar/wrapper.js
@@ -0,0 +1,21 @@
+// dependencies
+define(['plugin/charts/highcharts/common/wrapper'], function(Highcharts) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary) {
+ // draw chart
+ var hc = new Highcharts(this.app, this.options);
+ hc.draw(process_id, 'column', chart, request_dictionary);
+ }
+});
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal/config.js
@@ -0,0 +1,24 @@
+define(['plugin/charts/highcharts/common/config'], function(config) {
+
+return $.extend(true, {}, config, {
+ title : 'Horizontal',
+ category : 'Bar diagrams',
+ columns : {
+ x : {
+ title : 'Values for x-axis',
+ is_label : true,
+ is_auto : true
+ },
+ y : {
+ title : 'Values for y-axis',
+ is_numeric : true
+ }
+ },
+ settings : {
+ x_axis_type : {
+ init : 'hide'
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal/logo.png
Binary file config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal/logo.png has changed
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal/wrapper.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal/wrapper.js
@@ -0,0 +1,25 @@
+// dependencies
+define(['plugin/charts/highcharts/common/wrapper'], function(Highcharts) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ // settings
+ chart.settings.set('x_axis_categories', [])
+
+ // draw chart
+ var hc = new Highcharts(this.app, this.options);
+ hc.draw(process_id, 'bar', chart, request_dictionary);
+ }
+});
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal_stacked/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal_stacked/config.js
@@ -0,0 +1,24 @@
+define(['plugin/charts/highcharts/common/config'], function(config) {
+
+return $.extend(true, {}, config, {
+ title : 'Stacked horizontal',
+ category : 'Bar diagrams',
+ settings : {
+ x_axis_type : {
+ init : 'hide'
+ }
+ },
+ columns : {
+ x : {
+ title : 'Values for x-axis',
+ is_label : true,
+ is_auto : true
+ },
+ y : {
+ title : 'Values for y-axis',
+ is_numeric : true
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal_stacked/logo.png
Binary file config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal_stacked/logo.png has changed
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal_stacked/wrapper.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/bar_horizontal_stacked/wrapper.js
@@ -0,0 +1,26 @@
+// dependencies
+define(['plugin/charts/highcharts/common/wrapper'], function(Highcharts) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ // finalize configuration
+ chart.settings.set('plotoptions_series_stacking', 'normal');
+ chart.settings.set('x_axis_categories', [])
+
+ // draw chart
+ var hc = new Highcharts(this.app, this.options);
+ hc.draw(process_id, 'bar', chart, request_dictionary);
+ }
+});
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar_stacked/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/bar_stacked/config.js
@@ -0,0 +1,19 @@
+define(['plugin/charts/highcharts/common/config'], function(config) {
+
+return $.extend(true, {}, config, {
+ title : 'Stacked',
+ category : 'Bar diagrams',
+ columns : {
+ x : {
+ title : 'Values for x-axis',
+ is_label : true,
+ is_auto : true
+ },
+ y : {
+ title : 'Values for y-axis',
+ is_numeric : true
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar_stacked/logo.png
Binary file config/plugins/visualizations/charts/static/charts/highcharts/bar_stacked/logo.png has changed
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/bar_stacked/wrapper.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/bar_stacked/wrapper.js
@@ -0,0 +1,26 @@
+// dependencies
+define(['plugin/charts/highcharts/common/wrapper'], function(Highcharts) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ // finalize configuration
+ chart.settings.set('plotoptions_series_stacking', 'normal');
+ chart.settings.set('x_axis_categories', [])
+
+ // draw chart
+ var hc = new Highcharts(this.app, this.options);
+ hc.draw(process_id, 'column', chart, request_dictionary);
+ }
+});
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/boxplot/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/boxplot/config.js
@@ -0,0 +1,41 @@
+define([], function() {
+
+return $.extend(true, {}, {
+ title : 'Box plot',
+ category : 'Data processing (requires \'charts\' tool from Toolshed)',
+ library : 'highcharts.js',
+ tag : 'div',
+ execute : 'boxplot',
+ columns : {
+ y : {
+ title : 'Observations',
+ is_numeric : true
+ }
+ },
+ settings : {
+ separator_label : {
+ title : 'X axis',
+ type : 'separator'
+ },
+ x_axis_label : {
+ title : 'Axis label',
+ info : 'Provide a label for the axis.',
+ type : 'text',
+ init : 'X-axis',
+ placeholder : 'Axis label'
+ },
+ separator_tick : {
+ title : 'Y axis',
+ type : 'separator'
+ },
+ y_axis_label : {
+ title : 'Axis label',
+ info : 'Provide a label for the axis.',
+ type : 'text',
+ init : 'Y-axis',
+ placeholder : 'Axis label'
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/boxplot/logo.png
Binary file config/plugins/visualizations/charts/static/charts/highcharts/boxplot/logo.png has changed
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/boxplot/wrapper.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/boxplot/wrapper.js
@@ -0,0 +1,81 @@
+// dependencies
+define(['plugin/charts/highcharts/common/highcharts-config'], function(configmaker) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ // configure request
+ var index = 0;
+ for (var i in request_dictionary.groups) {
+ var group = request_dictionary.groups[i];
+ group.columns = null;
+ group.columns = {
+ x: {
+ index: index++
+ }
+ }
+ }
+
+ // hide legend
+ chart.settings.set('legend_enabled', 'false')
+
+ // create configuration
+ this.hc_config = configmaker(chart.settings);
+
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function() {
+
+ // reset data/categories
+ var data = [];
+ var categories = [];
+
+ // loop through data groups
+ for (var key in request_dictionary.groups) {
+ // get group
+ var group = request_dictionary.groups[key];
+
+ // add category
+ categories.push(group.key);
+
+ // format chart data
+ var point = [];
+ for (var key in group.values) {
+ point.push(group.values[key].x);
+ }
+
+ // add to data
+ data.push (point);
+ }
+
+ // categories
+ self.hc_config.xAxis.categories = categories;
+
+ // update data
+ self.hc_config.series.push({
+ type : 'boxplot',
+ data : data
+ });
+
+ // draw plot
+ self.options.canvas[0].highcharts(self.hc_config);
+
+ // set chart state
+ chart.state('ok', 'Box plot drawn.');
+
+ // unregister process
+ chart.deferred.done(process_id);
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/common/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/common/config.js
@@ -0,0 +1,216 @@
+define([], function() {
+
+return {
+ title : '',
+ category : '',
+ library : 'highcharts',
+ tag : 'div',
+ settings : {
+ separator_label : {
+ title : 'X axis',
+ type : 'separator'
+ },
+ x_axis_label : {
+ title : 'Axis label',
+ info : 'Provide a label for the axis.',
+ type : 'text',
+ init : 'X-axis',
+ placeholder : 'Axis label'
+ },
+ x_axis_type : {
+ title : 'Axis value type',
+ info : 'Select the value type of the axis.',
+ type : 'select',
+ init : 'auto',
+ data : [
+ {
+ label : '-- Do not show values --',
+ value : 'hide',
+ hide : ['x_axis_tick']
+ },
+ {
+ label : 'Auto',
+ value : 'auto',
+ hide : ['x_axis_tick']
+ },
+ {
+ label : 'Float',
+ value : 'f',
+ show : ['x_axis_tick']
+ },
+ {
+ label : 'Exponent',
+ value : 'e',
+ show : ['x_axis_tick']
+ },
+ {
+ label : 'Integer',
+ value : 'd',
+ hide : ['x_axis_tick']
+ },
+ {
+ label : 'Percentage',
+ value : 'p',
+ show : ['x_axis_tick']
+ },
+ {
+ label : 'Rounded',
+ value : 'r',
+ show : ['x_axis_tick']
+ },
+ {
+ label : 'SI-prefix',
+ value : 's',
+ show : ['x_axis_tick']
+ }
+ ]
+ },
+ x_axis_tick : {
+ title : 'Axis tick format',
+ info : 'Select the tick format for the axis.',
+ type : 'select',
+ init : '.1',
+ data : [
+ {
+ label : '0.00001',
+ value : '.5'
+ },
+ {
+ label : '0.0001',
+ value : '.4'
+ },
+ {
+ label : '0.001',
+ value : '.3'
+ },
+ {
+ label : '0.01',
+ value : '.2'
+ },
+ {
+ label : '0.1',
+ value : '.1'
+ },
+ {
+ label : '1',
+ value : '1'
+ }
+ ]
+
+ },
+ separator_tick : {
+ title : 'Y axis',
+ type : 'separator'
+ },
+ y_axis_label : {
+ title : 'Axis label',
+ info : 'Provide a label for the axis.',
+ type : 'text',
+ init : 'Y-axis',
+ placeholder : 'Axis label'
+ },
+ y_axis_type : {
+ title : 'Axis value type',
+ info : 'Select the value type of the axis.',
+ type : 'select',
+ init : 'auto',
+ data : [
+ {
+ label : '-- Do not show values --',
+ value : 'hide',
+ hide : ['y_axis_tick']
+ },
+ {
+ label : 'Auto',
+ value : 'auto',
+ hide : ['y_axis_tick']
+ },
+ {
+ label : 'Float',
+ value : 'f',
+ show : ['y_axis_tick']
+ },
+ {
+ label : 'Exponent',
+ value : 'e',
+ show : ['y_axis_tick']
+ },
+ {
+ label : 'Integer',
+ value : 'd',
+ hide : ['y_axis_tick']
+ },
+ {
+ label : 'Percentage',
+ value : 'p',
+ show : ['y_axis_tick']
+ },
+ {
+ label : 'Rounded',
+ value : 'r',
+ show : ['y_axis_tick']
+ },
+ {
+ label : 'SI-prefix',
+ value : 's',
+ show : ['y_axis_tick']
+ }
+ ]
+ },
+ y_axis_tick : {
+ title : 'Axis tick format',
+ info : 'Select the tick format for the axis.',
+ type : 'select',
+ init : '.1',
+ data : [
+ {
+ label : '0.00001',
+ value : '.5'
+ },
+ {
+ label : '0.0001',
+ value : '.4'
+ },
+ {
+ label : '0.001',
+ value : '.3'
+ },
+ {
+ label : '0.01',
+ value : '.2'
+ },
+ {
+ label : '0.1',
+ value : '.1'
+ },
+ {
+ label : '1',
+ value : '1'
+ }
+ ]
+
+ },
+ separator_legend : {
+ title : 'Others',
+ type : 'separator'
+ },
+ legend_enabled : {
+ title : 'Show legend',
+ info : 'Would you like to add a legend?',
+ type : 'select',
+ init : 'true',
+ data : [
+ {
+ label : 'Yes',
+ value : 'true'
+ },
+ {
+ label : 'No',
+ value : 'false'
+ }
+ ]
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/common/highcharts-config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/common/highcharts-config.js
@@ -0,0 +1,114 @@
+// dependencies
+define([], function() {
+
+// widget
+return function(settings) {
+ // highcharts configuration
+ return {
+ chart: {
+ type : '',
+ zoomType : 'xy'
+ },
+
+ title: {
+ text : ''
+ },
+
+ legend: {
+ enabled : settings.get('legend_enabled') == undefined || settings.get('legend_enabled') == 'true'
+ },
+
+ credits: {
+ enabled : false
+ },
+
+ xAxis: {
+ categories : settings.get('x_axis_categories'),
+ title: {
+ text : settings.get('x_axis_label')
+ },
+ stackLabels: {
+ enabled: false,
+ style: {
+ fontWeight : 'bold',
+ color : (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
+ }
+ },
+ tickPixelInterval : 100
+ },
+
+ yAxis: {
+ title: {
+ text : settings.get('y_axis_label')
+ }
+ },
+
+ plotOptions: {
+ series: {
+ animation : false,
+ stacking : settings.get('plotoptions_series_stacking')
+ },
+ column: {
+ stacking : settings.get('plotoptions_column_stacking')
+ },
+ area: {
+ stacking : settings.get('plotoptions_area_stacking'),
+ lineColor : '#ffffff',
+ lineWidth : 1,
+ marker: {
+ lineWidth : 1,
+ lineColor : '#ffffff'
+ }
+ },
+ pie: {
+ allowPointSelect : true,
+ cursor : 'pointer',
+ dataLabels: {
+ enabled : false,
+ distance : -1
+ }
+ }
+ },
+
+ series: []
+ }/*,
+
+ // highcharts stacking
+ hc_stacklabels: {
+ enabled: true,
+ style: {
+ fontWeight: 'bold',
+ color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
+ }
+ },
+
+ // initialize
+ initialize: function(settings) {
+ // stacking
+ if (settings.get('x_stacked')) {
+ this.hc_config.xAxis.stackLabels = this.hc_stacklabels;
+ this.hc_config.plotOptions.column = {
+ stacking : 'normal',
+ dataLabels : {
+ enabled : true,
+ color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white',
+ style: {
+ textShadow: '0 0 3px black, 0 0 3px black'
+ }
+ }
+ }
+ }
+
+ // stacking
+ if (settings.get('y_stacked')) {
+ this.hc_config.yAxis.stackLabels = this.hc_stacklabels;
+ this.hc_config.plotOptions.column = {
+ stacking : 'normal'
+ }
+ }
+
+ console.log(this.hc_config);
+ }*/
+};
+
+});
\ No newline at end of file
diff -r a223d4188a2489c71d86f6ba0e6698573f384d7d -r 18db7291e89062110a3c81df9293a68935779c47 config/plugins/visualizations/charts/static/charts/highcharts/common/wrapper.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/highcharts/common/wrapper.js
@@ -0,0 +1,97 @@
+// dependencies
+define(['utils/utils', 'plugin/charts/highcharts/common/highcharts-config'], function(Utils, configmaker) {
+
+// widget
+return Backbone.View.extend(
+{
+ // highcharts series
+ hc_series: {
+ name : '',
+ data : [],
+ tooltip: {
+ headerFormat : '<em>{point.key}</em><br/>'
+ }
+ },
+
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, hc_type, chart, request_dictionary, callback)
+ {
+ // create configuration
+ this.hc_config = configmaker(chart.settings);
+
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function() {
+ if (self.options.canvas.length == 1) {
+ // groups
+ self._drawGroups(hc_type, chart, request_dictionary.groups, self.options.canvas[0]);
+
+ // set chart state
+ chart.state('ok', 'Chart drawn.');
+ } else {
+ // loop through data groups
+ for (var group_index in request_dictionary.groups) {
+ // get group
+ var group = request_dictionary.groups[group_index];
+
+ // draw group
+ self._drawGroups(hc_type, chart, [group], self.options.canvas[group_index]);
+ }
+
+ // set chart state
+ chart.state('ok', 'Multi-panel chart drawn.');
+ }
+
+ // unregister process
+ chart.deferred.done(process_id);
+ });
+ },
+
+ // draw all data into a single canvas
+ _drawGroups: function(hc_type, chart, groups, canvas) {
+ // reset
+ this.hc_config.series = [];
+
+ // loop through data groups
+ for (var key in groups) {
+ // get group
+ var group = groups[key];
+
+ // reset data
+ var data = [];
+
+ // format chart data
+ for (var value_index in group.values) {
+ // parse data
+ var point = [];
+ for (var column_index in group.values[value_index]) {
+ point.push(group.values[value_index][column_index]);
+ }
+
+ // add to data
+ data.push (point);
+ }
+
+ // highcharts series
+ var hc_series = {
+ name : group.key,
+ type : hc_type,
+ data : data
+ };
+
+ // append series
+ this.hc_config.series.push(hc_series);
+ }
+
+ // draw plot
+ canvas.highcharts(this.hc_config);
+ }
+});
+
+});
\ No newline at end of file
This diff is so big that we needed to truncate the remainder.
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: jgoecks: Small fix for Trackster location routing.
by commits-noreply@bitbucket.org 30 May '14
by commits-noreply@bitbucket.org 30 May '14
30 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a223d4188a24/
Changeset: a223d4188a24
User: jgoecks
Date: 2014-05-31 01:16:30
Summary: Small fix for Trackster location routing.
Affected #: 1 file
diff -r 315997fa7d2f060a33d72950579b6b518aa4cfb0 -r a223d4188a2489c71d86f6ba0e6698573f384d7d static/scripts/viz/visualization.js
--- a/static/scripts/viz/visualization.js
+++ b/static/scripts/viz/visualization.js
@@ -1052,7 +1052,7 @@
// Can't put regular expression in routes dictionary.
// NOTE: parentheses are used to denote parameters returned to callback.
this.route(/([\w]+)$/, 'change_location');
- this.route(/([\w]+\:[\d,]+-[\d,]+)$/, 'change_location');
+ this.route(/([\w\+]+\:[\d,]+-[\d,]+)$/, 'change_location');
// Handle navigate events from view.
var self = this;
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: All tool_data_table paths must now be declared with field name "path"...
by commits-noreply@bitbucket.org 30 May '14
by commits-noreply@bitbucket.org 30 May '14
30 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/315997fa7d2f/
Changeset: 315997fa7d2f
User: jmchilton
Date: 2014-05-30 23:12:40
Summary: All tool_data_table paths must now be declared with field name "path"...
... or they will not work correctly with the LWR. This is making explicit a convention that was already followed by all devteam tools. If need arises for multiple paths in the same data table or there is an important tool out there that does not label it's paths as "path" let me know and we can try to implement some XML markup in the tool_data_table.xml file to declare these fields as paths.
Use new assumption to cleanup what LWR considers unstructured paths (unstructured paths is no longer even a good name for this concept unfortunately).
Affected #: 2 files
diff -r 638dcaad4b8dcabf236d732af6f451a92cdcf2bc -r 315997fa7d2f060a33d72950579b6b518aa4cfb0 lib/galaxy/jobs/runners/lwr_client/path_mapper.py
--- a/lib/galaxy/jobs/runners/lwr_client/path_mapper.py
+++ b/lib/galaxy/jobs/runners/lwr_client/path_mapper.py
@@ -53,9 +53,6 @@
return remote_path
def check_for_arbitrary_rewrite(self, local_path):
- if not os.path.exists(local_path):
- return None, []
-
path = str(local_path) # Use false_path if needed.
action = self.action_mapper.action(path, path_type.UNSTRUCTURED)
if not action.staging_needed:
diff -r 638dcaad4b8dcabf236d732af6f451a92cdcf2bc -r 315997fa7d2f060a33d72950579b6b518aa4cfb0 lib/galaxy/tools/wrappers.py
--- a/lib/galaxy/tools/wrappers.py
+++ b/lib/galaxy/tools/wrappers.py
@@ -5,6 +5,15 @@
from logging import getLogger
log = getLogger( __name__ )
+# Fields in .log files corresponding to paths, must have one of the following
+# field names and all such fields are assumed to be paths. This is to allow
+# remote ComputeEnvironments (such as one used by LWR) determine what values to
+# rewrite or transfer...
+PATH_ATTRIBUTES = [ "path" ]
+# ... by default though - don't rewrite anything (if no ComputeEnviornment
+# defined or ComputeEnvironment doesn't supply a rewriter).
+DEFAULT_PATH_REWRITER = lambda x: x
+
class ToolParameterValueWrapper( object ):
"""
@@ -88,9 +97,6 @@
return getattr( self.value, key )
-DEFAULT_PATH_REWRITER = lambda x: x
-
-
class SelectToolParameterWrapper( ToolParameterValueWrapper ):
"""
Wraps a SelectTooParameter so that __str__ returns the selected value, but all other
@@ -112,7 +118,11 @@
def __getattr__( self, name ):
if name not in self._fields:
self._fields[ name ] = self._input.options.get_field_by_name_for_value( name, self._value, None, self._other_values )
- return self._input.separator.join( map( self._path_rewriter, map( str, self._fields[ name ] ) ) )
+ values = map( str, self._fields[ name ] )
+ if name in PATH_ATTRIBUTES:
+ # If we infer this is a path, rewrite it if needed.
+ values = map( self._path_rewriter, values )
+ return self._input.separator.join( values )
def __init__( self, input, value, app, other_values={}, path_rewriter=None ):
self.input = input
@@ -123,7 +133,9 @@
self.fields = self.SelectToolParameterFieldWrapper( input, value, other_values, self._path_rewriter )
def __str__( self ):
- return self.input.to_param_dict_string( self.value, other_values=self._other_values, value_map=self._path_rewriter )
+ # Assuming value is never a path - otherwise would need to pass
+ # along following argument value_map=self._path_rewriter.
+ return self.input.to_param_dict_string( self.value, other_values=self._other_values )
def __getattr__( self, key ):
return getattr( self.input, key )
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: jgoecks: Load datasets into Scratchbook using divs rather than an iframe. Push URLs for TabularChunkedView into model, enable Scratchbook to use a function to load content, enable scrolling in frames, and some code/documentation fixes.
by commits-noreply@bitbucket.org 30 May '14
by commits-noreply@bitbucket.org 30 May '14
30 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/638dcaad4b8d/
Changeset: 638dcaad4b8d
User: jgoecks
Date: 2014-05-30 22:28:17
Summary: Load datasets into Scratchbook using divs rather than an iframe. Push URLs for TabularChunkedView into model, enable Scratchbook to use a function to load content, enable scrolling in frames, and some code/documentation fixes.
Affected #: 4 files
diff -r 79e1326aebb77ece64475a041ed8ca4b612d9e5e -r 638dcaad4b8dcabf236d732af6f451a92cdcf2bc static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -69,6 +69,8 @@
// If first data chunk is available, next chunk is 1.
this.attributes.chunk_index = (this.attributes.first_data_chunk ? 1 : 0);
+ this.attributes.chunk_url = galaxy_config.root + 'dataset/display?dataset_id=' + this.id;
+ this.attributes.url_viz = galaxy_config.root + 'visualization';
},
/**
@@ -617,8 +619,10 @@
* and appends to parent_elt.
*/
var createTabularDatasetChunkedView = function(options) {
- // Create and set model.
- options.model = new TabularDataset(options.dataset_config);
+ // If no model, create and set model from dataset config.
+ if (!options.model) {
+ options.model = new TabularDataset(options.dataset_config);
+ }
var parent_elt = options.parent_elt;
var embedded = options.embedded;
diff -r 79e1326aebb77ece64475a041ed8ca4b612d9e5e -r 638dcaad4b8dcabf236d732af6f451a92cdcf2bc static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -1,8 +1,9 @@
define([
"mvc/dataset/hda-model",
"mvc/base-mvc",
+ "mvc/data",
"utils/localization"
-], function( hdaModel, baseMVC, _l ){
+], function( hdaModel, baseMVC, dataset, _l ){
/* global Backbone */
/** @class Read only view for history content views to extend.
@@ -313,14 +314,24 @@
var self = this;
displayBtnData.onclick = function( ev ){
if( Galaxy.frame && Galaxy.frame.active ){
+ // Create frame with TabularChunkedView.
Galaxy.frame.add({
title : "Data Viewer: " + self.model.get('name'),
- type : "url",
- content : self.urls.display
+ type : "other",
+ content : function(parent_elt) {
+ var new_dataset = new dataset.TabularDataset({id: self.model.id});
+ $.when(new_dataset.fetch()).then(function() {
+ dataset.createTabularDatasetChunkedView({
+ model: new_dataset,
+ parent_elt: parent_elt,
+ embedded: true,
+ height: '100%'
+ });
+ });
+ }
});
ev.preventDefault();
}
-
};
}
displayBtnData.faIcon = 'fa-eye';
diff -r 79e1326aebb77ece64475a041ed8ca4b612d9e5e -r 638dcaad4b8dcabf236d732af6f451a92cdcf2bc static/scripts/mvc/ui/ui-frames.js
--- a/static/scripts/mvc/ui/ui-frames.js
+++ b/static/scripts/mvc/ui/ui-frames.js
@@ -136,7 +136,15 @@
});
},
- // adds and displays a new frame/window
+ /**
+ * Adds and displays a new frame.
+ *
+ * options:
+ * type: 'url' or 'other' ; if 'url', 'content' is treated as a URL and loaded into an iframe;
+ * if 'other', content is treated as a function or raw HTML. content function is passed a single
+ * argument that is the frame's content DOM element
+ * content: the content to be loaded into the frame.
+ */
add: function(options)
{
// frame default options
@@ -180,11 +188,21 @@
// append
var $frame_el = null;
- if (options.type == 'url') {
+ if (options.type === 'url') {
$frame_el = $(this._template_frame_url(frame_id.substring(1), options.title, options.content));
- } else {
+ }
+ else if (options.type === 'other') {
$frame_el = $(this._template_frame(frame_id.substring(1), options.title));
- $frame_el.find('.f-content').append(options.content);
+
+ // Load content into frame.
+ var content_elt = $frame_el.find('.f-content');
+ console.log(content_elt);
+ if (_.isFunction(options.content)) {
+ options.content(content_elt);
+ }
+ else {
+ content_elt.append(options.content);
+ }
}
$(this.el).append($frame_el);
@@ -529,13 +547,23 @@
this.hide();
},
- // scroll
+ /**
+ * Fired when scrolling occurs on panel.
+ */
_event_panel_scroll: function(e)
{
// check
if (this.event.type !== null || !this.visible)
return;
-
+
+ // Stop propagation if scrolling is happening inside a frame.
+ // TODO: could propagate scrolling if at top/bottom of frame.
+ var frames = $(e.srcElement).parents('.frame')
+ if (frames.length !== 0) {
+ e.stopPropagation();
+ return;
+ }
+
// prevent
e.preventDefault();
diff -r 79e1326aebb77ece64475a041ed8ca4b612d9e5e -r 638dcaad4b8dcabf236d732af6f451a92cdcf2bc templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -19,9 +19,6 @@
data.createTabularDatasetChunkedView({
dataset_config: _.extend( ${h.to_json_string( trans.security.encode_dict_ids( dataset.to_dict() ) )},
{
- url_viz: "${h.url_for( controller='/visualization')}",
- chunk_url: "${h.url_for( controller='/dataset', action='display',
- dataset_id=trans.security.encode_id( dataset.id ))}",
first_data_chunk: ${chunk}
}
),
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: dannon: Resolve merge across branches.
by commits-noreply@bitbucket.org 30 May '14
by commits-noreply@bitbucket.org 30 May '14
30 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/79e1326aebb7/
Changeset: 79e1326aebb7
User: dannon
Date: 2014-05-30 22:06:08
Summary: Resolve merge across branches.
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
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/aeacb40b527f/
Changeset: aeacb40b527f
Branch: next-stable
User: dannon
Date: 2014-05-30 21:59:32
Summary: Pack scripts.
Affected #: 1 file
diff -r aa58945453ab7a5ced6852a731a9dabb531f27d6 -r aeacb40b527f06eb7dc4138ab871b26a88b8d709 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;s.show();$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false;s.hide()}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/ebd72ac674d4/
Changeset: ebd72ac674d4
User: dannon
Date: 2014-05-30 22:00:49
Summary: Pack scripts.
Affected #: 1 file
diff -r 67549a8abdafdf2455d5190f3582c8ccfdac7a48 -r ebd72ac674d45a4c0ff20e1e224036e870b0fb21 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this,n=this.model.get("first_data_chunk");if(n){this._renderChunk(n)}else{$.when(o.model.get_next_chunk()).then(function(t){o._renderChunk(t)})}var p=false;this.scroll_elt.scroll(function(){if(!p&&o.scrolled_to_bottom()){p=true;s.show();$.when(o.model.get_next_chunk()).then(function(t){if(t){o._renderChunk(t);p=false;s.hide()}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ 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
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/aa58945453ab/
Changeset: aa58945453ab
Branch: next-stable
User: dannon
Date: 2014-05-30 21:52:49
Summary: Fix loading indicator jqmigrate griping. Also improve it to where it's not looking for a global ajaxstart/ajaxstop.
Affected #: 1 file
diff -r cb1e86b187a38fce1b9601115fc1a51809f3b292 -r aa58945453ab7a5ced6852a731a9dabb531f27d6 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -135,14 +135,8 @@
render: function() {
// Add loading indicator.
var loading_indicator = $('<div/>').attr('id', 'loading_indicator');
+ this.$el.append(loading_indicator);
- loading_indicator.ajaxStart(function(){
- $(this).show();
- }).ajaxStop(function(){
- $(this).hide();
- });
-
- this.$el.append(loading_indicator);
// Add data table and header.
var data_table = $('<table/>').attr({
id: 'content_table',
@@ -172,10 +166,12 @@
// If not already loading a chunk and have scrolled to the bottom of this element, get next chunk.
if ( !loading_chunk && self.scrolled_to_bottom() ) {
loading_chunk = true;
+ loading_indicator.show();
$.when(self.model.get_next_chunk()).then(function(result) {
if (result) {
self._renderChunk(result);
loading_chunk = false;
+ loading_indicator.hide();
}
});
}
https://bitbucket.org/galaxy/galaxy-central/commits/67549a8abdaf/
Changeset: 67549a8abdaf
User: dannon
Date: 2014-05-30 21:53:13
Summary: Merge next-stable.
Affected #: 1 file
diff -r 25ab1fe9dbc7659fbf3cdfea26d5f03e4c521701 -r 67549a8abdafdf2455d5190f3582c8ccfdac7a48 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -135,14 +135,8 @@
render: function() {
// Add loading indicator.
var loading_indicator = $('<div/>').attr('id', 'loading_indicator');
+ this.$el.append(loading_indicator);
- loading_indicator.ajaxStart(function(){
- $(this).show();
- }).ajaxStop(function(){
- $(this).hide();
- });
-
- this.$el.append(loading_indicator);
// Add data table and header.
var data_table = $('<table/>').attr({
id: 'content_table',
@@ -179,10 +173,12 @@
// If not already loading a chunk and have scrolled to the bottom of this element, get next chunk.
if ( !loading_chunk && self.scrolled_to_bottom() ) {
loading_chunk = true;
+ loading_indicator.show();
$.when(self.model.get_next_chunk()).then(function(result) {
if (result) {
self._renderChunk(result);
loading_chunk = false;
+ loading_indicator.hide();
}
});
}
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
12 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e14f0956dfc9/
Changeset: e14f0956dfc9
Branch: next-stable
User: dannon
Date: 2014-05-28 15:47:22
Summary: Cleanup prior to tabular work.
Affected #: 3 files
diff -r eed45027e219df9c4fc87fcfc788380ecc500b1a -r e14f0956dfc984a11d495eb59f77131596110ae4 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -633,9 +633,9 @@
};
return {
- Dataset: Dataset,
+ Dataset: Dataset,
TabularDataset: TabularDataset,
- DatasetCollection: DatasetCollection,
+ DatasetCollection: DatasetCollection,
TabularDatasetChunkedView: TabularDatasetChunkedView,
createTabularDatasetChunkedView: createTabularDatasetChunkedView
};
diff -r eed45027e219df9c4fc87fcfc788380ecc500b1a -r e14f0956dfc984a11d495eb59f77131596110ae4 templates/webapps/galaxy/dataset/display.mako
--- a/templates/webapps/galaxy/dataset/display.mako
+++ b/templates/webapps/galaxy/dataset/display.mako
@@ -9,7 +9,7 @@
%if item.datatype.CHUNKABLE:
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -17,21 +17,21 @@
});
require(['mvc/data'], function(data) {
- //
+ //
// Use tabular data display progressively by deleting data from page body
// and then showing dataset view.
- //
+ //
$('.page-body').children().remove();
data.createTabularDatasetChunkedView({
// TODO: encode id.
- dataset_config:
- _.extend( ${h.to_json_string( item.to_dict() )},
+ dataset_config:
+ _.extend( ${h.to_json_string( item.to_dict() )},
{
- chunk_url: "${h.url_for( controller='/dataset', action='display',
+ chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( item.id ))}",
first_data_chunk: ${first_chunk}
- }
+ }
),
parent_elt: $('.page-body')
});
@@ -58,9 +58,9 @@
<%def name="render_item_links( data )">
## Provide links to save data and import dataset.
<a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a>
- <a
+ <a
href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}"
- class="icon-button import"
+ class="icon-button import"
title="Import dataset"></a></%def>
@@ -70,7 +70,7 @@
%if data_to_render:
%if truncated:
<div class="warningmessagelarge">
- This dataset is large and only the first megabyte is shown below. |
+ This dataset is large and only the first megabyte is shown below. |
<a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div>
%endif
@@ -100,9 +100,9 @@
| ${get_item_name( item ) | h}
</div></div>
-
+
<div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
+ <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right">
${self.render_item_links( item )}
@@ -110,7 +110,7 @@
<div>
${self.render_item_header( item )}
</div>
-
+
${self.render_item( item, item_data )}
</div></div>
@@ -123,20 +123,20 @@
About this ${get_class_display_name( item.__class__ )}
</div></div>
-
+
<div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4>
-
+
<p>${item.history.user.username | h}</p>
-
+
<div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=iden…"></div>
- ## Page meta.
-
+ ## Page meta.
+
## No links for datasets right now.
-
+
## Tags.
<p><h4>Tags</h4>
@@ -155,8 +155,8 @@
Yours:
${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )}
</div>
- </div>
+ </div></div></div>
-</%def>
\ No newline at end of file
+</%def>
diff -r eed45027e219df9c4fc87fcfc788380ecc500b1a -r e14f0956dfc984a11d495eb59f77131596110ae4 templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -8,7 +8,7 @@
${h.js( "libs/require" )}
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -23,7 +23,7 @@
chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( dataset.id ))}",
first_data_chunk: ${chunk}
- }
+ }
),
parent_elt: $('body')
});
https://bitbucket.org/galaxy/galaxy-central/commits/e0470cb34e7a/
Changeset: e0470cb34e7a
Branch: next-stable
User: dannon
Date: 2014-05-29 14:22:47
Summary: Merge.
Affected #: 1 file
diff -r e14f0956dfc984a11d495eb59f77131596110ae4 -r e0470cb34e7a14198fa635055abd81def09bba06 job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -204,6 +204,10 @@
using message queues (in the more traditional mode Galaxy sends
files to and pull files from the LWR - this is obviously less
appropriate when using a message queue).
+
+ The default_file_action currently requires pycurl be available
+ to Galaxy (presumably in its virtualenv). Making this dependency
+ optional is an open task.
--><param id="default_file_action">remote_transfer</param></destination>
https://bitbucket.org/galaxy/galaxy-central/commits/b99e3eee6217/
Changeset: b99e3eee6217
User: dannon
Date: 2014-05-29 14:23:03
Summary: Merge next-stable.
Affected #: 3 files
diff -r 34d179b55c859f9c669c73733bde2684cf9d4a9f -r b99e3eee6217db24efa3fad12bd5c00289522056 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -640,9 +640,9 @@
};
return {
- Dataset: Dataset,
+ Dataset: Dataset,
TabularDataset: TabularDataset,
- DatasetCollection: DatasetCollection,
+ DatasetCollection: DatasetCollection,
TabularDatasetChunkedView: TabularDatasetChunkedView,
createTabularDatasetChunkedView: createTabularDatasetChunkedView
};
diff -r 34d179b55c859f9c669c73733bde2684cf9d4a9f -r b99e3eee6217db24efa3fad12bd5c00289522056 templates/webapps/galaxy/dataset/display.mako
--- a/templates/webapps/galaxy/dataset/display.mako
+++ b/templates/webapps/galaxy/dataset/display.mako
@@ -9,7 +9,7 @@
%if item.datatype.CHUNKABLE:
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -17,21 +17,21 @@
});
require(['mvc/data'], function(data) {
- //
+ //
// Use tabular data display progressively by deleting data from page body
// and then showing dataset view.
- //
+ //
$('.page-body').children().remove();
data.createTabularDatasetChunkedView({
// TODO: encode id.
- dataset_config:
- _.extend( ${h.to_json_string( item.to_dict() )},
+ dataset_config:
+ _.extend( ${h.to_json_string( item.to_dict() )},
{
- chunk_url: "${h.url_for( controller='/dataset', action='display',
+ chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( item.id ))}",
first_data_chunk: ${first_chunk}
- }
+ }
),
parent_elt: $('.page-body')
});
@@ -58,9 +58,9 @@
<%def name="render_item_links( data )">
## Provide links to save data and import dataset.
<a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a>
- <a
+ <a
href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}"
- class="icon-button import"
+ class="icon-button import"
title="Import dataset"></a></%def>
@@ -70,7 +70,7 @@
%if data_to_render:
%if truncated:
<div class="warningmessagelarge">
- This dataset is large and only the first megabyte is shown below. |
+ This dataset is large and only the first megabyte is shown below. |
<a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div>
%endif
@@ -100,9 +100,9 @@
| ${get_item_name( item ) | h}
</div></div>
-
+
<div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
+ <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right">
${self.render_item_links( item )}
@@ -110,7 +110,7 @@
<div>
${self.render_item_header( item )}
</div>
-
+
${self.render_item( item, item_data )}
</div></div>
@@ -123,20 +123,20 @@
About this ${get_class_display_name( item.__class__ )}
</div></div>
-
+
<div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4>
-
+
<p>${item.history.user.username | h}</p>
-
+
<div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=iden…"></div>
- ## Page meta.
-
+ ## Page meta.
+
## No links for datasets right now.
-
+
## Tags.
<p><h4>Tags</h4>
@@ -155,8 +155,8 @@
Yours:
${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )}
</div>
- </div>
+ </div></div></div>
-</%def>
\ No newline at end of file
+</%def>
diff -r 34d179b55c859f9c669c73733bde2684cf9d4a9f -r b99e3eee6217db24efa3fad12bd5c00289522056 templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -8,7 +8,7 @@
${h.js( "libs/require" )}
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -23,7 +23,7 @@
chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( dataset.id ))}",
first_data_chunk: ${chunk}
- }
+ }
),
parent_elt: $('body')
});
https://bitbucket.org/galaxy/galaxy-central/commits/60aa2c0c0b21/
Changeset: 60aa2c0c0b21
User: dannon
Date: 2014-05-29 22:28:08
Summary: merge.
Affected #: 1 file
diff -r b99e3eee6217db24efa3fad12bd5c00289522056 -r 60aa2c0c0b21f4c52b1f83c7f19d0b148e198ee0 lib/galaxy/visualization/registry.py
--- a/lib/galaxy/visualization/registry.py
+++ b/lib/galaxy/visualization/registry.py
@@ -243,10 +243,11 @@
datatype_class_name = test_result
test_result = trans.app.datatypes_registry.get_datatype_class_by_name( datatype_class_name )
if not test_result:
- # warn if can't find class, but continue (with other tests)
- log.warn( 'visualizations_registry cannot find class (%s)' +
- ' for applicability test on: %s, id: %s', datatype_class_name,
- target_object, getattr( target_object, 'id', '' ) )
+ # but continue (with other tests) if can't find class by that name
+ #if self.debug:
+ # log.warn( 'visualizations_registry cannot find class (%s)' +
+ # ' for applicability test on: %s, id: %s', datatype_class_name,
+ # target_object, getattr( target_object, 'id', '' ) )
continue
#NOTE: tests are OR'd, if any test passes - the visualization can be applied
https://bitbucket.org/galaxy/galaxy-central/commits/a37133f7364d/
Changeset: a37133f7364d
Branch: next-stable
User: dannon
Date: 2014-05-30 17:11:32
Summary: Add loading indicator back that disappeared (unintentionally?) in b12b245510be
Affected #: 1 file
diff -r b8fef1dfa8e8eb5afdeaa96236a0a9990f7c532b -r a37133f7364d75f3749e9eb72c0195b446dce781 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -133,6 +133,16 @@
},
render: function() {
+ // Add loading indicator.
+ var loading_indicator = $('<div/>').attr('id', 'loading_indicator');
+
+ loading_indicator.ajaxStart(function(){
+ $(this).show();
+ }).ajaxStop(function(){
+ $(this).hide();
+ });
+
+ this.$el.append(loading_indicator);
// Add data table and header.
var data_table = $('<table/>').attr({
id: 'content_table',
@@ -170,11 +180,6 @@
});
}
});
- $('#loading_indicator').ajaxStart(function(){
- $(this).show();
- }).ajaxStop(function(){
- $(this).hide();
- });
},
/**
https://bitbucket.org/galaxy/galaxy-central/commits/79a9d2b2c110/
Changeset: 79a9d2b2c110
User: dannon
Date: 2014-05-30 17:11:46
Summary: Merge.
Affected #: 1 file
diff -r 60aa2c0c0b21f4c52b1f83c7f19d0b148e198ee0 -r 79a9d2b2c11024b5cd3a67ef84f25d9c07029a85 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -133,6 +133,16 @@
},
render: function() {
+ // Add loading indicator.
+ var loading_indicator = $('<div/>').attr('id', 'loading_indicator');
+
+ loading_indicator.ajaxStart(function(){
+ $(this).show();
+ }).ajaxStop(function(){
+ $(this).hide();
+ });
+
+ this.$el.append(loading_indicator);
// Add data table and header.
var data_table = $('<table/>').attr({
id: 'content_table',
@@ -177,11 +187,6 @@
});
}
});
- $('#loading_indicator').ajaxStart(function(){
- $(this).show();
- }).ajaxStop(function(){
- $(this).hide();
- });
},
/**
https://bitbucket.org/galaxy/galaxy-central/commits/afb293ca337b/
Changeset: afb293ca337b
Branch: next-stable
User: dannon
Date: 2014-05-30 17:33:08
Summary: Pack scripts.
Affected #: 1 file
diff -r a37133f7364d75f3749e9eb72c0195b446dce781 -r afb293ca337be1e04a34f22a310367d99ff2a38f static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/47fbab3029e5/
Changeset: 47fbab3029e5
User: dannon
Date: 2014-05-30 17:33:18
Summary: Merge next-stable.
Affected #: 1 file
diff -r 79a9d2b2c11024b5cd3a67ef84f25d9c07029a85 -r 47fbab3029e5fe1a1f3334bbcfa46c5856c63bc7 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/cded8178bb48/
Changeset: cded8178bb48
Branch: next-stable
User: dannon
Date: 2014-05-30 17:34:15
Summary: Merge.
Affected #: 1 file
diff -r afb293ca337be1e04a34f22a310367d99ff2a38f -r cded8178bb4834236d9ae6239c14b928ae2d282b lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -498,7 +498,7 @@
# Check that the file is in the right location
local_filename = os.path.abspath( value['path'] )
assert local_filename.startswith( upload_store ), \
- "Filename provided by nginx is not in correct directory"
+ "Filename provided by nginx (%s) is not in correct directory (%s)" % (local_filename, upload_store)
value = dict(
filename=value["name"],
local_filename=local_filename
https://bitbucket.org/galaxy/galaxy-central/commits/f48fbe6866a5/
Changeset: f48fbe6866a5
User: dannon
Date: 2014-05-30 17:35:27
Summary: Merge
Affected #: 2 files
diff -r 3409e283965f58ec4bf96594f980a8e6ee2cb058 -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -133,6 +133,16 @@
},
render: function() {
+ // Add loading indicator.
+ var loading_indicator = $('<div/>').attr('id', 'loading_indicator');
+
+ loading_indicator.ajaxStart(function(){
+ $(this).show();
+ }).ajaxStop(function(){
+ $(this).hide();
+ });
+
+ this.$el.append(loading_indicator);
// Add data table and header.
var data_table = $('<table/>').attr({
id: 'content_table',
@@ -177,11 +187,6 @@
});
}
});
- $('#loading_indicator').ajaxStart(function(){
- $(this).show();
- }).ajaxStop(function(){
- $(this).hide();
- });
},
/**
diff -r 3409e283965f58ec4bf96594f980a8e6ee2cb058 -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/cb1e86b187a3/
Changeset: cb1e86b187a3
Branch: next-stable
User: dannon
Date: 2014-05-30 17:37:13
Summary: Merge.
Affected #: 3 files
diff -r cded8178bb4834236d9ae6239c14b928ae2d282b -r cb1e86b187a38fce1b9601115fc1a51809f3b292 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -638,9 +638,9 @@
};
return {
- Dataset: Dataset,
+ Dataset: Dataset,
TabularDataset: TabularDataset,
- DatasetCollection: DatasetCollection,
+ DatasetCollection: DatasetCollection,
TabularDatasetChunkedView: TabularDatasetChunkedView,
createTabularDatasetChunkedView: createTabularDatasetChunkedView
};
diff -r cded8178bb4834236d9ae6239c14b928ae2d282b -r cb1e86b187a38fce1b9601115fc1a51809f3b292 templates/webapps/galaxy/dataset/display.mako
--- a/templates/webapps/galaxy/dataset/display.mako
+++ b/templates/webapps/galaxy/dataset/display.mako
@@ -9,7 +9,7 @@
%if item.datatype.CHUNKABLE:
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -17,21 +17,21 @@
});
require(['mvc/data'], function(data) {
- //
+ //
// Use tabular data display progressively by deleting data from page body
// and then showing dataset view.
- //
+ //
$('.page-body').children().remove();
data.createTabularDatasetChunkedView({
// TODO: encode id.
- dataset_config:
- _.extend( ${h.to_json_string( item.to_dict() )},
+ dataset_config:
+ _.extend( ${h.to_json_string( item.to_dict() )},
{
- chunk_url: "${h.url_for( controller='/dataset', action='display',
+ chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( item.id ))}",
first_data_chunk: ${first_chunk}
- }
+ }
),
parent_elt: $('.page-body')
});
@@ -58,9 +58,9 @@
<%def name="render_item_links( data )">
## Provide links to save data and import dataset.
<a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a>
- <a
+ <a
href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}"
- class="icon-button import"
+ class="icon-button import"
title="Import dataset"></a></%def>
@@ -70,7 +70,7 @@
%if data_to_render:
%if truncated:
<div class="warningmessagelarge">
- This dataset is large and only the first megabyte is shown below. |
+ This dataset is large and only the first megabyte is shown below. |
<a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div>
%endif
@@ -100,9 +100,9 @@
| ${get_item_name( item ) | h}
</div></div>
-
+
<div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
+ <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right">
${self.render_item_links( item )}
@@ -110,7 +110,7 @@
<div>
${self.render_item_header( item )}
</div>
-
+
${self.render_item( item, item_data )}
</div></div>
@@ -123,20 +123,20 @@
About this ${get_class_display_name( item.__class__ )}
</div></div>
-
+
<div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4>
-
+
<p>${item.history.user.username | h}</p>
-
+
<div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=iden…"></div>
- ## Page meta.
-
+ ## Page meta.
+
## No links for datasets right now.
-
+
## Tags.
<p><h4>Tags</h4>
@@ -155,8 +155,8 @@
Yours:
${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )}
</div>
- </div>
+ </div></div></div>
-</%def>
\ No newline at end of file
+</%def>
diff -r cded8178bb4834236d9ae6239c14b928ae2d282b -r cb1e86b187a38fce1b9601115fc1a51809f3b292 templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -8,7 +8,7 @@
${h.js( "libs/require" )}
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -23,7 +23,7 @@
chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( dataset.id ))}",
first_data_chunk: ${chunk}
- }
+ }
),
parent_elt: $('body')
});
https://bitbucket.org/galaxy/galaxy-central/commits/25ab1fe9dbc7/
Changeset: 25ab1fe9dbc7
User: dannon
Date: 2014-05-30 17:38:13
Summary: Merge.
Affected #: 3 files
diff -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 -r 25ab1fe9dbc7659fbf3cdfea26d5f03e4c521701 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -645,9 +645,9 @@
};
return {
- Dataset: Dataset,
+ Dataset: Dataset,
TabularDataset: TabularDataset,
- DatasetCollection: DatasetCollection,
+ DatasetCollection: DatasetCollection,
TabularDatasetChunkedView: TabularDatasetChunkedView,
createTabularDatasetChunkedView: createTabularDatasetChunkedView
};
diff -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 -r 25ab1fe9dbc7659fbf3cdfea26d5f03e4c521701 templates/webapps/galaxy/dataset/display.mako
--- a/templates/webapps/galaxy/dataset/display.mako
+++ b/templates/webapps/galaxy/dataset/display.mako
@@ -9,7 +9,7 @@
%if item.datatype.CHUNKABLE:
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -17,21 +17,21 @@
});
require(['mvc/data'], function(data) {
- //
+ //
// Use tabular data display progressively by deleting data from page body
// and then showing dataset view.
- //
+ //
$('.page-body').children().remove();
data.createTabularDatasetChunkedView({
// TODO: encode id.
- dataset_config:
- _.extend( ${h.to_json_string( item.to_dict() )},
+ dataset_config:
+ _.extend( ${h.to_json_string( item.to_dict() )},
{
- chunk_url: "${h.url_for( controller='/dataset', action='display',
+ chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( item.id ))}",
first_data_chunk: ${first_chunk}
- }
+ }
),
parent_elt: $('.page-body')
});
@@ -58,9 +58,9 @@
<%def name="render_item_links( data )">
## Provide links to save data and import dataset.
<a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a>
- <a
+ <a
href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}"
- class="icon-button import"
+ class="icon-button import"
title="Import dataset"></a></%def>
@@ -70,7 +70,7 @@
%if data_to_render:
%if truncated:
<div class="warningmessagelarge">
- This dataset is large and only the first megabyte is shown below. |
+ This dataset is large and only the first megabyte is shown below. |
<a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div>
%endif
@@ -100,9 +100,9 @@
| ${get_item_name( item ) | h}
</div></div>
-
+
<div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
+ <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right">
${self.render_item_links( item )}
@@ -110,7 +110,7 @@
<div>
${self.render_item_header( item )}
</div>
-
+
${self.render_item( item, item_data )}
</div></div>
@@ -123,20 +123,20 @@
About this ${get_class_display_name( item.__class__ )}
</div></div>
-
+
<div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4>
-
+
<p>${item.history.user.username | h}</p>
-
+
<div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=iden…"></div>
- ## Page meta.
-
+ ## Page meta.
+
## No links for datasets right now.
-
+
## Tags.
<p><h4>Tags</h4>
@@ -155,8 +155,8 @@
Yours:
${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )}
</div>
- </div>
+ </div></div></div>
-</%def>
\ No newline at end of file
+</%def>
diff -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 -r 25ab1fe9dbc7659fbf3cdfea26d5f03e4c521701 templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -8,7 +8,7 @@
${h.js( "libs/require" )}
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -23,7 +23,7 @@
chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( dataset.id ))}",
first_data_chunk: ${chunk}
- }
+ }
),
parent_elt: $('body')
});
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