galaxy-commits
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- 15302 discussions
commit/galaxy-central: dannon: Adjust require order in cloudlaunch controller.
by commits-noreply@bitbucket.org 05 May '14
by commits-noreply@bitbucket.org 05 May '14
05 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/92519a9bfa32/
Changeset: 92519a9bfa32
User: dannon
Date: 2014-05-05 15:28:41
Summary: Adjust require order in cloudlaunch controller.
Affected #: 1 file
diff -r a45f6e57f3d5a4075430a6d460a6caded611b867 -r 92519a9bfa32a42ce47a63fdb72c8e2d717ec52e lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
--- a/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
+++ b/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
@@ -15,9 +15,9 @@
from galaxy.web.base.controller import BaseUIController
from galaxy.util.json import to_json_string
+eggs.require('pyyaml')
eggs.require('boto')
eggs.require('bioblend')
-eggs.require('pyyaml')
from boto.exception import EC2ResponseError
@@ -73,7 +73,7 @@
result = cml.launch(cluster_name, ami, instance_type, password,
cfg.kernel_id, cfg.ramdisk_id, cfg.key_name,
cfg.security_groups, cfg.placement)
- #result is a dict with sg_names, kp_name, kp_material, rs, and instance_id
+ # result is a dict with sg_names, kp_name, kp_material, rs, and instance_id
if not result['rs']:
trans.response.status = 400
return "Instance failure, but no specific error was detected. Please check your AWS Console."
@@ -86,7 +86,7 @@
pass
time.sleep(1)
if result['kp_material']:
- #We have created a keypair. Save to tempfile for one time retrieval.
+ # We have created a keypair. Save to tempfile for one time retrieval.
(fd, fname) = tempfile.mkstemp(prefix=PKEY_PREFIX, dir=trans.app.config.new_file_path)
f = os.fdopen(fd, 'wt')
f.write(result['kp_material'])
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: Fix env job metrics plugin for multi-line properties.
by commits-noreply@bitbucket.org 05 May '14
by commits-noreply@bitbucket.org 05 May '14
05 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a45f6e57f3d5/
Changeset: a45f6e57f3d5
User: jmchilton
Date: 2014-05-05 01:17:36
Summary: Fix env job metrics plugin for multi-line properties.
Thanks to Nicola Soranzo for detailed bug report.
Affected #: 1 file
diff -r 116d7867f3f8efca5fdc2998bb3bb5df55724529 -r a45f6e57f3d5a4075430a6d460a6caded611b867 lib/galaxy/jobs/metrics/instrumenters/env.py
--- a/lib/galaxy/jobs/metrics/instrumenters/env.py
+++ b/lib/galaxy/jobs/metrics/instrumenters/env.py
@@ -42,6 +42,13 @@
properties = {}
for line in open( self.__env_file( job_directory ) ).readlines():
+ if "=" not in line:
+ # Previous line may have had a multiline property value, just
+ # keep it simple here and only record the first part of
+ # property. A more robust solution might be to record env -O
+ # so properties are terminated by null characters instead of
+ # newlines.
+ continue
var, value = line.split( "=", 1 )
if not variables or var in variables:
properties[ var ] = value
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Charts: Implement heatmap sort for sparse data
by commits-noreply@bitbucket.org 03 May '14
by commits-noreply@bitbucket.org 03 May '14
03 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/116d7867f3f8/
Changeset: 116d7867f3f8
User: guerler
Date: 2014-05-03 21:39:40
Summary: Charts: Implement heatmap sort for sparse data
Affected #: 1 file
diff -r fd8cf23297536147d5bbeed5b8b5d501eb8e84bf -r 116d7867f3f8efca5fdc2998bb3bb5df55724529 config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
@@ -20,19 +20,24 @@
// 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,
- margin : {
- top : 50,
- right : 10,
- bottom : 50,
- left : 100
- }
},
// initialize
@@ -107,20 +112,19 @@
// generate sorted key list for rows
for (var i in this.rowLabel) {
var row_label = this.rowLabel[i];
- var row_rank = parseInt(i);
- this.rowRank[row_label] = row_rank;
+ 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_rank = parseInt(i);
- this.colRank[col_label] = col_rank;
+ var col = parseInt(i);
+ this.colRank[col_label] = col;
}
//
// parse indexing from rank dictionary to cells
- // identify data range
//
// min/max
@@ -133,8 +137,8 @@
var cell = this.data[i];
// add rank
- cell.col_rank = this.colRank[cell.col_label];
- cell.row_rank = this.rowRank[cell.row_label];
+ 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) {
@@ -199,17 +203,20 @@
// link this
var self = this;
- // container
- var container_width = this.$el.width();
- var container_height = this.$el.height();
+ // container (full draw area)
+ this.widthContainer = this.$el.width();
+ this.heightContainer = this.$el.height();
- // get height
- this.width = this.$el.width() - this.options.margin.left - this.options.margin.right;
- this.height = this.$el.height() - this.options.margin.top - this.options.margin.bottom;
+ // get grid dimensions
+ this.width = this.widthContainer;
+ this.height = this.heightContainer;
// calculate cell size
- this.cellSize = Math.min(parseInt(this.height / this.rowNumber),
- parseInt(this.width / this.colNumber));
+ this.cellSize = Math.min(((this.height - 50) / (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;
@@ -222,10 +229,9 @@
// add main group and translate
this.svg = d3.select(this.$el[0]).append('svg')
- .attr('width', width + margin.left + margin.right)
- .attr('height', height + margin.top + margin.bottom)
.append('g')
- .attr('transform', 'translate(' + (container_width - width) / 2 + ',' + (container_height - height) / 2 + ')')
+ .attr('transform', 'translate(' + (this.widthContainer - width) / 2 + ',' +
+ (this.heightContainer - height) / 2 + ')')
// reset sorting
this.rowSortOrder = false;
@@ -245,15 +251,17 @@
var self = this;
// gather data
- var height = this.height;
- var width = this.width;
- var title = this.options.title;
+ var height = this.height;
+ var width = this.width;
+ var cellSize = this.cellSize;
+ var fontSize = this.fontSize;
+ var title = this.options.title;
// add title
this.svg.append('g')
.append('text')
.attr('x', width / 2)
- .attr('y', height - 10)
+ .attr('y', height + 3 * cellSize + fontSize + 3)
.attr('text-anchor', 'middle')
.text(title);
},
@@ -265,6 +273,7 @@
// gather data
var cellSize = this.cellSize;
+ var fontSize = this.fontSize;
var height = this.height;
var legendCellWidth = this.width / this.nColors;
@@ -312,8 +321,8 @@
.attr('x', function(d, i) {
return legendCellWidth * i;
})
- .attr('y', height + cellSize)
- .style('font-size', cellSize + 'px');
+ .attr('y', height + cellSize - 3)
+ .style('font-size', fontSize + 'px');
},
// build column labels
@@ -323,6 +332,7 @@
// gather data
var cellSize = this.cellSize;
+ var fontSize = this.fontSize;
var colIndex = this.colIndex;
var colLabel = this.colLabel;
@@ -339,7 +349,7 @@
.attr('y', function (d, i) {
return colIndex.indexOf(i) * cellSize;
})
- .style('font-size', cellSize + 'px')
+ .style('font-size', fontSize + 'px')
.style('text-anchor', 'left')
.attr('transform', 'translate(' + cellSize / 2 + ', -17) rotate (-90)')
.attr('class', function (d, i) {
@@ -347,15 +357,13 @@
})
.on('mouseover', function(d) {
d3.select(this).classed('text-hover',true);
- d3.select(this).style('font-size', parseInt(cellSize * 1.3) + 'px');
})
.on('mouseout' , function(d) {
d3.select(this).classed('text-hover',false);
- d3.select(this).style('font-size', parseInt(cellSize) + 'px');
})
.on('click', function(d, i) {
self.colSortOrder=!self.colSortOrder;
- self._sortByLabel('c', i, self.colSortOrder);
+ self._sortByLabel('c', 'row', self.rowNumber, i, self.colSortOrder);
d3.select('#order').property('selectedIndex', 4).node().focus();
});
},
@@ -367,6 +375,7 @@
// gather data
var cellSize = this.cellSize;
+ var fontSize = this.fontSize;
var rowIndex = this.rowIndex;
var rowLabel = this.rowLabel;
@@ -383,7 +392,7 @@
.attr('y', function (d, i) {
return rowIndex.indexOf(i) * cellSize;
})
- .style('font-size', cellSize + 'px')
+ .style('font-size', fontSize + 'px')
.style('text-anchor', 'end')
.attr('transform', 'translate(-10,' + cellSize / 1.5 + ')')
.attr('class', function (d, i) {
@@ -391,15 +400,13 @@
} )
.on('mouseover', function(d) {
d3.select(this).classed('text-hover',true);
- d3.select(this).style('font-size', parseInt(cellSize * 1.3) + 'px');
})
.on('mouseout' , function(d) {
d3.select(this).classed('text-hover',false);
- d3.select(this).style('font-size', parseInt(cellSize) + 'px');
})
.on('click', function(d, i) {
self.rowSortOrder=!self.rowSortOrder;
- self._sortByLabel('r', i, self.rowSortOrder);
+ self._sortByLabel('r', 'col', self.colNumber, i, self.rowSortOrder);
d3.select('#order').property('selectedIndex', 4).node().focus();
});
},
@@ -420,18 +427,18 @@
var heatMap = this.svg.append('g').attr('class','g3')
.selectAll('.cellg')
.data(self.data, function(d) {
- return d.row_rank + ':' + d.col_rank;
+ return d.row + ':' + d.col;
})
.enter()
.append('rect')
.attr('x', function(d) {
- return colIndex.indexOf(d.col_rank) * cellSize;
+ return colIndex.indexOf(d.col) * cellSize;
})
.attr('y', function(d) {
- return rowIndex.indexOf(d.row_rank) * cellSize;
+ return rowIndex.indexOf(d.row) * cellSize;
})
.attr('class', function(d){
- return 'cell cell-border cr' + d.row_rank + ' cc' + d.col_rank;
+ return 'cell cell-border cr' + d.row + ' cc' + d.col;
})
.attr('width', cellSize)
.attr('height', cellSize)
@@ -441,15 +448,15 @@
.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_rank);});
- d3.selectAll('.colLabel').classed('text-highlight',function(c,ci){ return ci==(d.col_rank);});
+ 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_rank] + ' | ' + colLabel[d.col_rank] + ', Value: ' + d.value);
+ .text('Label: ' + rowLabel[d.row] + ' | ' + colLabel[d.col] + ', Value: ' + d.value);
// show the tooltip
d3.select('#heatmap-tooltip').classed('hidden', false);
})
@@ -462,18 +469,25 @@
},
// change ordering of cells
- _sortByLabel: function(rORc, i, sortOrder) {
+ _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
- var cells=[];
- t.selectAll('.c' + rORc + i)
- .filter(function(ce){
- cells.push(ce);
+ t.selectAll('.c' + rORc + index).filter(function(ce) {
+ cells[ce[rowORcol]].value = ce.value;
});
// sort cells
@@ -484,19 +498,19 @@
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') {
- // get sorted key list
- var sorted = [];
- for (var i in cells) {
- sorted.push(cells[i].col_rank);
- }
-
// sort cells
t.selectAll('.cell')
.attr('x', function(d) {
- return sorted.indexOf(d.col_rank) * cellSize;
+ return sorted.indexOf(d.col) * cellSize;
});
// sort labels
@@ -505,23 +519,17 @@
return sorted.indexOf(i) * cellSize;
});
} else {
- // get sorted key list
- sorted = [];
- for (var i in cells) {
- sorted.push(cells[i].row_rank);
- }
-
// sort cells
t.selectAll('.cell')
.attr('y', function(d) {
- return sorted.indexOf(d.row_rank) * cellSize;
- });
-
+ return sorted.indexOf(d.row) * cellSize;
+ });
+
// sort labels
t.selectAll('.rowLabel')
.attr('y', function (d, i) {
return sorted.indexOf(i) * cellSize;
- });
+ });
}
},
@@ -542,10 +550,10 @@
if(value=='hclust'){
t.selectAll('.cell')
.attr('x', function(d) {
- return colIndex.indexOf(d.col_rank) * cellSize;
+ return colIndex.indexOf(d.col) * cellSize;
})
.attr('y', function(d) {
- return rowIndex.indexOf(d.row_rank) * cellSize;
+ return rowIndex.indexOf(d.row) * cellSize;
});
t.selectAll('.rowLabel')
@@ -561,10 +569,10 @@
} else if (value=='byboth') {
t.selectAll('.cell')
.attr('x', function(d) {
- return d.col_rank * cellSize;
+ return d.col * cellSize;
})
.attr('y', function(d) {
- return d.row_rank * cellSize;
+ return d.row * cellSize;
});
t.selectAll('.rowLabel')
@@ -579,7 +587,7 @@
} else if (value=='byrow') {
t.selectAll('.cell')
.attr('y', function(d) {
- return d.row_rank * cellSize;
+ return d.row * cellSize;
});
t.selectAll('.rowLabel')
@@ -589,7 +597,7 @@
} else if (value=='bycol'){
t.selectAll('.cell')
.attr('x', function(d) {
- return d.col_rank * cellSize;
+ return d.col * cellSize;
});
t.selectAll('.colLabel')
.attr('y', function (d, i) {
@@ -666,11 +674,11 @@
.classed('cell-selection', true)
.classed('cell-selected', true);
- d3.select('.r'+(cell_d.row_rank))
+ d3.select('.r' + cell_d.row)
.classed('text-selection',true)
.classed('text-selected',true);
- d3.select('.c'+(cell_d.col_rank))
+ d3.select('.c' + cell_d.col)
.classed('text-selection',true)
.classed('text-selected',true);
}
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
03 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fd8cf2329753/
Changeset: fd8cf2329753
User: guerler
Date: 2014-05-03 02:12:26
Summary: Charts: Add labels
Affected #: 2 files
diff -r 21121d6283a95942061819f5e788ab41cfc1c000 -r fd8cf23297536147d5bbeed5b8b5d501eb8e84bf config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
@@ -25,6 +25,7 @@
// default settings
optionsDefault: {
+ title : '',
pace : 1000,
margin : {
top : 50,
@@ -231,12 +232,32 @@
this.colSortOrder = false;
// build
- this.rowLabels = this._buildRowLabels();
- this.colLabels = this._buildColLabels();
- this.heatMap = this._buildHeatMap();
- this.legend = this._buildLegend();
+ this._buildRowLabels();
+ this._buildColLabels();
+ this._buildHeatMap();
+ this._buildLegend();
+ this._buildTitle();
},
+ // build title
+ _buildTitle: function() {
+ // link this
+ var self = this;
+
+ // gather data
+ var height = this.height;
+ var width = this.width;
+ var title = this.options.title;
+
+ // add title
+ this.svg.append('g')
+ .append('text')
+ .attr('x', width / 2)
+ .attr('y', height - 10)
+ .attr('text-anchor', 'middle')
+ .text(title);
+ },
+
// build legend
_buildLegend: function() {
// link this
diff -r 21121d6283a95942061819f5e788ab41cfc1c000 -r fd8cf23297536147d5bbeed5b8b5d501eb8e84bf config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
@@ -22,12 +22,14 @@
for (var group_index in request_dictionary.groups) {
// get group
var group = request_dictionary.groups[group_index];
-
+ var div = self.options.canvas[group_index];
+
// draw plot
var heatmap = new HeatmapPlugin({
- 'colors' : HeatmapParameters.colorSets[chart.settings.get('color_set')],
- 'data' : group.values,
- 'div' : self.options.canvas[group_index]
+ 'title' : group.key,
+ 'colors' : HeatmapParameters.colorSets[chart.settings.get('color_set')],
+ 'data' : group.values,
+ 'div' : div
});
}
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Charts: Add color combos, fixes for heatmaps
by commits-noreply@bitbucket.org 03 May '14
by commits-noreply@bitbucket.org 03 May '14
03 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/21121d6283a9/
Changeset: 21121d6283a9
User: guerler
Date: 2014-05-03 01:40:37
Summary: Charts: Add color combos, fixes for heatmaps
Affected #: 4 files
diff -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/config.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/config.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/config.js
@@ -17,6 +17,97 @@
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'
+ }
+ ]
+ }
}
};
diff -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/heatmap-parameters.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-parameters.js
@@ -0,0 +1,52 @@
+// 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 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
@@ -1,5 +1,6 @@
// dependencies
-define(['utils/utils'], function(Utils) {
+define(['utils/utils'],
+function(Utils) {
// widget
return Backbone.View.extend(
@@ -30,8 +31,7 @@
right : 10,
bottom : 50,
left : 100
- },
- colors : ['#005824','#1A693B','#347B53','#4F8D6B','#699F83','#83B09B','#9EC2B3','#B8D4CB','#D2E6E3','#EDF8FB','#FFFFFF','#F1EEF6','#E6D3E1','#DBB9CD','#D19EB9','#C684A4','#BB6990','#B14F7C','#A63467','#9B1A53','#91003F']
+ }
},
// initialize
@@ -43,8 +43,8 @@
this.options = Utils.merge(options, this.optionsDefault)
// check requirements
- if (!this.options.data || !this.options.div) {
- console.debug('FAILED - HeatMapPlugin::initialize() - Parameters (container and/or data) missing.');
+ 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;
}
@@ -221,10 +221,10 @@
// add main group and translate
this.svg = d3.select(this.$el[0]).append('svg')
- .attr("width", width + margin.left + margin.right)
- .attr("height", height + margin.top + margin.bottom)
- .append("g")
- .attr("transform", "translate(" + (container_width - width) / 2 + "," + (container_height - height) / 2 + ")")
+ .attr('width', width + margin.left + margin.right)
+ .attr('height', height + margin.top + margin.bottom)
+ .append('g')
+ .attr('transform', 'translate(' + (container_width - width) / 2 + ',' + (container_height - height) / 2 + ')')
// reset sorting
this.rowSortOrder = false;
@@ -264,35 +264,35 @@
dataRange[dataRangeMax] = this.max;
// create legend
- var legend = this.svg.selectAll(".legend")
+ var legend = this.svg.selectAll('.legend')
.data(dataRange)
- .enter().append("g")
- .attr("class", "legend");
+ .enter().append('g')
+ .attr('class', 'legend');
// add boxes
- legend.append("rect")
- .attr("x", function(d, i) {
+ 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) {
+ .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")
+ legend.append('text')
+ .attr('class', 'mono')
.text(function(d) {
return d;
})
- .attr("width", legendCellWidth)
- .attr("x", function(d, i) {
+ .attr('width', legendCellWidth)
+ .attr('x', function(d, i) {
return legendCellWidth * i;
})
- .attr("y", height + cellSize)
- .style("font-size", cellSize + "px");
+ .attr('y', height + cellSize)
+ .style('font-size', cellSize + 'px');
},
// build column labels
@@ -306,36 +306,36 @@
var colLabel = this.colLabel;
// column labels
- var colLabels = this.svg.append("g")
- .selectAll(".colLabelg")
+ var colLabels = this.svg.append('g')
+ .selectAll('.colLabelg')
.data(colLabel)
.enter()
- .append("text")
+ .append('text')
.text(function (d) {
return d;
})
- .attr("x", 0)
- .attr("y", function (d, i) {
+ .attr('x', 0)
+ .attr('y', function (d, i) {
return colIndex.indexOf(i) * cellSize;
})
- .style("font-size", cellSize + "px")
- .style("text-anchor", "left")
- .attr("transform", "translate(" + cellSize / 2 + ", -17) rotate (-90)")
- .attr("class", function (d, i) {
- return "colLabel mono c" + i;
+ .style('font-size', cellSize + '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);
- d3.select(this).style("font-size", parseInt(cellSize * 1.3) + "px");
+ .on('mouseover', function(d) {
+ d3.select(this).classed('text-hover',true);
+ d3.select(this).style('font-size', parseInt(cellSize * 1.3) + 'px');
})
- .on("mouseout" , function(d) {
- d3.select(this).classed("text-hover",false);
- d3.select(this).style("font-size", parseInt(cellSize) + "px");
+ .on('mouseout' , function(d) {
+ d3.select(this).classed('text-hover',false);
+ d3.select(this).style('font-size', parseInt(cellSize) + 'px');
})
- .on("click", function(d, i) {
+ .on('click', function(d, i) {
self.colSortOrder=!self.colSortOrder;
- self._sortByLabel("c", i, self.colSortOrder);
- d3.select("#order").property("selectedIndex", 4).node().focus();
+ self._sortByLabel('c', i, self.colSortOrder);
+ d3.select('#order').property('selectedIndex', 4).node().focus();
});
},
@@ -350,36 +350,36 @@
var rowLabel = this.rowLabel;
// draw labels
- var rowLabels = this.svg.append("g")
- .selectAll(".rowLabelg")
+ var rowLabels = this.svg.append('g')
+ .selectAll('.rowLabelg')
.data(rowLabel)
.enter()
- .append("text")
+ .append('text')
.text(function (d) {
return d;
})
- .attr("x", 0)
- .attr("y", function (d, i) {
+ .attr('x', 0)
+ .attr('y', function (d, i) {
return rowIndex.indexOf(i) * cellSize;
})
- .style("font-size", cellSize + "px")
- .style("text-anchor", "end")
- .attr("transform", "translate(-10," + cellSize / 1.5 + ")")
- .attr("class", function (d, i) {
- return "rowLabel mono r" + i;
+ .style('font-size', cellSize + '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);
- d3.select(this).style("font-size", parseInt(cellSize * 1.3) + "px");
+ .on('mouseover', function(d) {
+ d3.select(this).classed('text-hover',true);
+ d3.select(this).style('font-size', parseInt(cellSize * 1.3) + 'px');
})
- .on("mouseout" , function(d) {
- d3.select(this).classed("text-hover",false);
- d3.select(this).style("font-size", parseInt(cellSize) + "px");
+ .on('mouseout' , function(d) {
+ d3.select(this).classed('text-hover',false);
+ d3.select(this).style('font-size', parseInt(cellSize) + 'px');
})
- .on("click", function(d, i) {
+ .on('click', function(d, i) {
self.rowSortOrder=!self.rowSortOrder;
- self._sortByLabel("r", i, self.rowSortOrder);
- d3.select("#order").property("selectedIndex", 4).node().focus();
+ self._sortByLabel('r', i, self.rowSortOrder);
+ d3.select('#order').property('selectedIndex', 4).node().focus();
});
},
@@ -396,47 +396,47 @@
var colLabel = this.colLabel;
// heat map
- var heatMap = this.svg.append("g").attr("class","g3")
- .selectAll(".cellg")
+ var heatMap = this.svg.append('g').attr('class','g3')
+ .selectAll('.cellg')
.data(self.data, function(d) {
- return d.row_rank + ":" + d.col_rank;
+ return d.row_rank + ':' + d.col_rank;
})
.enter()
- .append("rect")
- .attr("x", function(d) {
+ .append('rect')
+ .attr('x', function(d) {
return colIndex.indexOf(d.col_rank) * cellSize;
})
- .attr("y", function(d) {
+ .attr('y', function(d) {
return rowIndex.indexOf(d.row_rank) * cellSize;
})
- .attr("class", function(d){
- return "cell cell-border cr" + d.row_rank + " cc" + d.col_rank;
+ .attr('class', function(d){
+ return 'cell cell-border cr' + d.row_rank + ' cc' + d.col_rank;
})
- .attr("width", cellSize)
- .attr("height", cellSize)
- .style("fill", function(d) {
+ .attr('width', cellSize)
+ .attr('height', cellSize)
+ .style('fill', function(d) {
return self.colorScale(d.value);
})
- .on("mouseover", function(d){
+ .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_rank);});
- d3.selectAll(".colLabel").classed("text-highlight",function(c,ci){ return ci==(d.col_rank);});
+ d3.select(this).classed('cell-hover',true);
+ d3.selectAll('.rowLabel').classed('text-highlight',function(r,ri){ return ri==(d.row_rank);});
+ d3.selectAll('.colLabel').classed('text-highlight',function(c,ci){ return ci==(d.col_rank);});
// 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_rank] + " | " + colLabel[d.col_rank] + ", Value: " + d.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_rank] + ' | ' + colLabel[d.col_rank] + ', Value: ' + d.value);
// show the tooltip
- d3.select("#heatmap-tooltip").classed("hidden", false);
+ 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);
+ .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);
});
},
@@ -450,7 +450,7 @@
// collect cells
var cells=[];
- t.selectAll(".c" + rORc + i)
+ t.selectAll('.c' + rORc + i)
.filter(function(ce){
cells.push(ce);
});
@@ -465,7 +465,7 @@
});
// rows or columns
- if(rORc == "r") {
+ if(rORc == 'r') {
// get sorted key list
var sorted = [];
for (var i in cells) {
@@ -473,14 +473,14 @@
}
// sort cells
- t.selectAll(".cell")
- .attr("x", function(d) {
+ t.selectAll('.cell')
+ .attr('x', function(d) {
return sorted.indexOf(d.col_rank) * cellSize;
});
// sort labels
- t.selectAll(".colLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.colLabel')
+ .attr('y', function (d, i) {
return sorted.indexOf(i) * cellSize;
});
} else {
@@ -491,14 +491,14 @@
}
// sort cells
- t.selectAll(".cell")
- .attr("y", function(d) {
+ t.selectAll('.cell')
+ .attr('y', function(d) {
return sorted.indexOf(d.row_rank) * cellSize;
});
// sort labels
- t.selectAll(".rowLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.rowLabel')
+ .attr('y', function (d, i) {
return sorted.indexOf(i) * cellSize;
});
}
@@ -518,60 +518,60 @@
// set duration / select element
var t = this.svg.transition().duration(this.options.pace);
- if(value=="hclust"){
- t.selectAll(".cell")
- .attr("x", function(d) {
+ if(value=='hclust'){
+ t.selectAll('.cell')
+ .attr('x', function(d) {
return colIndex.indexOf(d.col_rank) * cellSize;
})
- .attr("y", function(d) {
+ .attr('y', function(d) {
return rowIndex.indexOf(d.row_rank) * cellSize;
});
- t.selectAll(".rowLabel")
- .attr("y", function(d, i) {
+ t.selectAll('.rowLabel')
+ .attr('y', function(d, i) {
return rowIndex.indexOf(i) * cellSize;
});
- t.selectAll(".colLabel")
- .attr("y", function(d, i) {
+ t.selectAll('.colLabel')
+ .attr('y', function(d, i) {
return colIndex.indexOf(i) * cellSize;
});
- } else if (value=="byboth") {
- t.selectAll(".cell")
- .attr("x", function(d) {
+ } else if (value=='byboth') {
+ t.selectAll('.cell')
+ .attr('x', function(d) {
return d.col_rank * cellSize;
})
- .attr("y", function(d) {
+ .attr('y', function(d) {
return d.row_rank * cellSize;
});
- t.selectAll(".rowLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.rowLabel')
+ .attr('y', function (d, i) {
return i * cellSize;
});
- t.selectAll(".colLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.colLabel')
+ .attr('y', function (d, i) {
return i * cellSize;
});
- } else if (value=="byrow") {
- t.selectAll(".cell")
- .attr("y", function(d) {
+ } else if (value=='byrow') {
+ t.selectAll('.cell')
+ .attr('y', function(d) {
return d.row_rank * cellSize;
});
- t.selectAll(".rowLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.rowLabel')
+ .attr('y', function (d, i) {
return i * cellSize;
});
- } else if (value=="bycol"){
- t.selectAll(".cell")
- .attr("x", function(d) {
+ } else if (value=='bycol'){
+ t.selectAll('.cell')
+ .attr('x', function(d) {
return d.col_rank * cellSize;
});
- t.selectAll(".colLabel")
- .attr("y", function (d, i) {
+ t.selectAll('.colLabel')
+ .attr('y', function (d, i) {
return i * cellSize;
});
}
@@ -582,35 +582,35 @@
//
// selection
//
- var sa=d3.select(".g3")
- .on("mousedown", function() {
+ 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);
+ 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")
+ sa.append('rect')
.attr({
rx : 0,
ry : 0,
- class : "selection",
+ class : 'selection',
x : p[0],
y : p[1],
width : 1,
height : 1
})
})
- .on("mousemove", function() {
- var s = sa.select("rect.selection");
+ .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)
+ 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,
@@ -633,46 +633,46 @@
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") &&
+ 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);
+ .classed('cell-selection', true)
+ .classed('cell-selected', true);
- d3.select(".r"+(cell_d.row_rank))
- .classed("text-selection",true)
- .classed("text-selected",true);
+ d3.select('.r'+(cell_d.row_rank))
+ .classed('text-selection',true)
+ .classed('text-selected',true);
- d3.select(".c"+(cell_d.col_rank))
- .classed("text-selection",true)
- .classed("text-selected",true);
+ d3.select('.c'+(cell_d.col_rank))
+ .classed('text-selection',true)
+ .classed('text-selected',true);
}
});
}
})
- .on("mouseup", function() {
+ .on('mouseup', function() {
// remove selection frame
- sa.selectAll("rect.selection").remove();
+ 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);
+ d3.selectAll('.cell-selection').classed('cell-selection', false);
+ d3.selectAll('.text-selection').classed('text-selection', false);
})
- .on("mouseout", function() {
+ .on('mouseout', function() {
if(d3.event.relatedTarget.tagName=='html') {
// remove selection frame
- sa.selectAll("rect.selection").remove();
+ 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);
+ d3.selectAll('.cell-selection').classed('cell-selection', false);
+ d3.selectAll('.rowLabel').classed('text-selected',false);
+ d3.selectAll('.colLabel').classed('text-selected',false);
}
});
},
diff -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 -r 21121d6283a95942061819f5e788ab41cfc1c000 config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap.js
@@ -1,5 +1,6 @@
// dependencies
-define(['utils/utils', 'plugin/charts/heatmap/heatmap-plugin'], function(Utils, HeatmapPlugin) {
+define(['utils/utils', 'plugin/charts/heatmap/heatmap-plugin', 'plugin/charts/heatmap/heatmap-parameters'],
+function(Utils, HeatmapPlugin, HeatmapParameters) {
// widget
return Backbone.View.extend(
@@ -24,8 +25,9 @@
// draw plot
var heatmap = new HeatmapPlugin({
- 'data' : group.values,
- 'div' : self.options.canvas[group_index]
+ 'colors' : HeatmapParameters.colorSets[chart.settings.get('color_set')],
+ 'data' : group.values,
+ 'div' : self.options.canvas[group_index]
});
}
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: martenson: data libraries: first take on shareable url for datasets
by commits-noreply@bitbucket.org 03 May '14
by commits-noreply@bitbucket.org 03 May '14
03 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9dd03d95b91c/
Changeset: 9dd03d95b91c
User: martenson
Date: 2014-05-03 00:00:23
Summary: data libraries: first take on shareable url for datasets
Affected #: 6 files
diff -r b852505038a8c3a05d0320ad7d00dccf7969a864 -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 static/scripts/galaxy.library.js
--- a/static/scripts/galaxy.library.js
+++ b/static/scripts/galaxy.library.js
@@ -30,6 +30,7 @@
routes: {
"" : "libraries",
"folders/:id" : "folder_content",
+ "folders/:folder_id/datasets/:dataset_id" : "dataset_detail",
"folders/:folder_id/download/:format" : "download"
}
});
@@ -88,6 +89,15 @@
}
});
+ this.library_router.on('route:dataset_detail', function(folder_id, dataset_id){
+ if (Galaxy.libraries.folderToolbarView){
+ Galaxy.libraries.folderToolbarView.$el.unbind('click');
+ }
+ Galaxy.libraries.folderToolbarView = new mod_foldertoolbar_view.FolderToolbarView({id: folder_id});
+ Galaxy.libraries.folderListView = new mod_folderlist_view.FolderListView({id: folder_id, dataset_id: dataset_id});
+ // Galaxy.libraries.folderListView.rowViews.get(dataset_id).showDatasetDetails();
+ });
+
Backbone.history.start({pushState: false});
}
});
diff -r b852505038a8c3a05d0320ad7d00dccf7969a864 -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 static/scripts/mvc/library/library-folderlist-view.js
--- a/static/scripts/mvc/library/library-folderlist-view.js
+++ b/static/scripts/mvc/library/library-folderlist-view.js
@@ -32,10 +32,12 @@
'click .dataset_row' : 'selectClickedRow',
'click .sort-folder-link' : 'sort_clicked'
},
+
+ // cache of rendered views
+ rowViews: {},
initialize : function(options){
this.options = _.defaults(this.options || {}, options);
-
this.fetchFolder();
},
@@ -62,6 +64,9 @@
that.folder_container = folder_container;
that.render();
that.addAll(folder_container.get('folder').models);
+ if (that.options.dataset_id){
+ _.findWhere(that.rowViews, {id: that.options.dataset_id}).showDatasetDetails();
+ }
},
error: function(model, response){
if (typeof response.responseJSON !== "undefined"){
@@ -148,7 +153,12 @@
this.options.contains_file = true;
model.set('readable_size', this.size_to_string(model.get('file_size')));
}
+ model.set('folder_id', this.id);
var rowView = new mod_library_folderrow_view.FolderRowView(model);
+
+ // save new rowView to cache
+ this.rowViews[model.get('id')] = rowView;
+
this.$el.find('#first_folder_item').after(rowView.el);
$('.deleted_dataset').hover(function() {
diff -r b852505038a8c3a05d0320ad7d00dccf7969a864 -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 static/scripts/mvc/library/library-folderrow-view.js
--- a/static/scripts/mvc/library/library-folderrow-view.js
+++ b/static/scripts/mvc/library/library-folderrow-view.js
@@ -15,7 +15,7 @@
lastSelectedHistory: '',
events: {
- 'click .library-dataset' : 'showDatasetDetails',
+ // 'click .library-dataset' : 'showDatasetDetails',
'click .undelete_dataset_btn' : 'undelete_dataset'
},
@@ -49,9 +49,10 @@
},
//show modal with current dataset info
- showDatasetDetails : function(event){
+ // showDatasetDetails : function(event){
+ showDatasetDetails : function(){
// prevent default
- event.preventDefault();
+ // event.preventDefault();
var id = this.id;
@@ -270,7 +271,7 @@
tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');
tmpl_array.push(' </td>');
tmpl_array.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');
- tmpl_array.push(' <td><a href="#" class="library-dataset"><%- content_item.get("name") %><a></td>'); // dataset
+ tmpl_array.push(' <td><a href="#folders/<%- content_item.get("folder_id") %>/datasets/<%- content_item.id %>" class="library-dataset"><%- content_item.get("name") %><a></td>'); // dataset
tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>'); // data type
tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>'); // size
tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>'); // time updated
diff -r b852505038a8c3a05d0320ad7d00dccf7969a864 -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 static/scripts/packed/galaxy.library.js
--- a/static/scripts/packed/galaxy.library.js
+++ b/static/scripts/packed/galaxy.library.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/base-mvc","mvc/library/library-model","mvc/library/library-folderlist-view","mvc/library/library-librarylist-view","mvc/library/library-librarytoolbar-view","mvc/library/library-foldertoolbar-view"],function(e,c,g,k,h,a,f,d,i){var l=Backbone.Router.extend({routes:{"":"libraries","folders/:id":"folder_content","folders/:folder_id/download/:format":"download"}});var j=k.SessionStorageModel.extend({defaults:{with_deleted:false,sort_order:"asc",sort_by:"name"}});var b=Backbone.View.extend({libraryToolbarView:null,libraryListView:null,library_router:null,folderToolbarView:null,folderListView:null,initialize:function(){Galaxy.libraries=this;this.preferences=new j({id:"global-lib-prefs"});this.library_router=new l();this.library_router.on("route:libraries",function(){Galaxy.libraries.libraryToolbarView=new d.LibraryToolbarView();Galaxy.libraries.libraryListView=new f.LibraryListView()});this.library_router.on("route:folder_content",function(m){if(Galaxy.libraries.folderToolbarView){Galaxy.libraries.folderToolbarView.$el.unbind("click")}Galaxy.libraries.folderToolbarView=new i.FolderToolbarView({id:m});Galaxy.libraries.folderListView=new a.FolderListView({id:m})});this.library_router.on("route:download",function(m,n){if($("#folder_list_body").find(":checked").length===0){g.info("You have to select some datasets to download");Galaxy.libraries.library_router.navigate("folders/"+m,{trigger:true,replace:true})}else{Galaxy.libraries.folderToolbarView.download(m,n);Galaxy.libraries.library_router.navigate("folders/"+m,{trigger:false,replace:true})}});Backbone.history.start({pushState:false})}});return{GalaxyApp:b}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/base-mvc","mvc/library/library-model","mvc/library/library-folderlist-view","mvc/library/library-librarylist-view","mvc/library/library-librarytoolbar-view","mvc/library/library-foldertoolbar-view"],function(e,c,g,k,h,a,f,d,i){var l=Backbone.Router.extend({routes:{"":"libraries","folders/:id":"folder_content","folders/:folder_id/datasets/:dataset_id":"dataset_detail","folders/:folder_id/download/:format":"download"}});var j=k.SessionStorageModel.extend({defaults:{with_deleted:false,sort_order:"asc",sort_by:"name"}});var b=Backbone.View.extend({libraryToolbarView:null,libraryListView:null,library_router:null,folderToolbarView:null,folderListView:null,initialize:function(){Galaxy.libraries=this;this.preferences=new j({id:"global-lib-prefs"});this.library_router=new l();this.library_router.on("route:libraries",function(){Galaxy.libraries.libraryToolbarView=new d.LibraryToolbarView();Galaxy.libraries.libraryListView=new f.LibraryListView()});this.library_router.on("route:folder_content",function(m){if(Galaxy.libraries.folderToolbarView){Galaxy.libraries.folderToolbarView.$el.unbind("click")}Galaxy.libraries.folderToolbarView=new i.FolderToolbarView({id:m});Galaxy.libraries.folderListView=new a.FolderListView({id:m})});this.library_router.on("route:download",function(m,n){if($("#folder_list_body").find(":checked").length===0){g.info("You have to select some datasets to download");Galaxy.libraries.library_router.navigate("folders/"+m,{trigger:true,replace:true})}else{Galaxy.libraries.folderToolbarView.download(m,n);Galaxy.libraries.library_router.navigate("folders/"+m,{trigger:false,replace:true})}});this.library_router.on("route:dataset_detail",function(n,m){if(Galaxy.libraries.folderToolbarView){Galaxy.libraries.folderToolbarView.$el.unbind("click")}Galaxy.libraries.folderToolbarView=new i.FolderToolbarView({id:n});Galaxy.libraries.folderListView=new a.FolderListView({id:n,dataset_id:m})});Backbone.history.start({pushState:false})}});return{GalaxyApp:b}});
\ No newline at end of file
diff -r b852505038a8c3a05d0320ad7d00dccf7969a864 -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 static/scripts/packed/mvc/library/library-folderlist-view.js
--- a/static/scripts/packed/mvc/library/library-folderlist-view.js
+++ b/static/scripts/packed/mvc/library/library-folderlist-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-folderrow-view"],function(c,e,f,d,a){var b=Backbone.View.extend({el:"#folder_items_element",defaults:{include_deleted:false},progress:0,progressStep:1,modal:null,folderContainer:null,sort:"asc",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .sort-folder-link":"sort_clicked"},initialize:function(g){this.options=_.defaults(this.options||{},g);this.fetchFolder()},fetchFolder:function(g){var g=g||{};this.options.include_deleted=g.include_deleted;var h=this;this.collection=new d.Folder();this.listenTo(this.collection,"add",this.renderOne);this.listenTo(this.collection,"remove",this.removeOne);this.folderContainer=new d.FolderContainer({id:this.options.id});this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents";if(this.options.include_deleted){this.folderContainer.url=this.folderContainer.url+"?include_deleted=true"}this.folderContainer.fetch({success:function(i){h.folder_container=i;h.render();h.addAll(i.get("folder").models)},error:function(j,i){if(typeof i.responseJSON!=="undefined"){f.error(i.responseJSON.err_msg)}else{f.error("An error ocurred :(")}}})},render:function(g){this.options=_.defaults(this.options,g);var h=this.templateFolder();var i=this.folderContainer.attributes.metadata.full_path;var j;if(i.length===1){j=0}else{j=i[i.length-2][0]}this.$el.html(h({path:this.folderContainer.attributes.metadata.full_path,id:this.options.id,upper_folder_id:j,order:this.sort}));$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},postRender:function(){var g=this.folderContainer.attributes.metadata;g.contains_file=typeof this.collection.findWhere({type:"file"})!=="undefined";Galaxy.libraries.folderToolbarView.configureElements(g);$(".deleted_dataset").hover(function(){$(this).find(".show_on_hover").show()},function(){$(this).find(".show_on_hover").hide()})},addAll:function(g){_.each(g.reverse(),function(h){Galaxy.libraries.folderListView.collection.add(h)});$("#center [data-toggle]").tooltip();this.checkEmptiness();this.postRender()},renderAll:function(){var g=this;_.each(this.collection.models.reverse(),function(h){g.renderOne(h)});this.postRender()},renderOne:function(h){if(h.get("data_type")!=="folder"){this.options.contains_file=true;h.set("readable_size",this.size_to_string(h.get("file_size")))}var g=new a.FolderRowView(h);this.$el.find("#first_folder_item").after(g.el);$(".deleted_dataset").hover(function(){$(this).find(".show_on_hover").show()},function(){$(this).find(".show_on_hover").hide()})},removeOne:function(g){this.$el.find("#"+g.id).remove()},checkEmptiness:function(){if((this.$el.find(".dataset_row").length===0)&&(this.$el.find(".folder_row").length===0)){this.$el.find(".empty-folder-message").show()}else{this.$el.find(".empty-folder-message").hide()}},sort_clicked:function(g){g.preventDefault();if(this.sort==="asc"){this.sortFolder("name","desc");this.sort="desc"}else{this.sortFolder("name","asc");this.sort="asc"}this.render();this.renderAll()},sortFolder:function(h,g){if(h==="name"){if(g==="asc"){return this.collection.sortByNameAsc()}else{if(g==="desc"){return this.collection.sortByNameDesc()}}}},size_to_string:function(g){var h="";if(g>=100000000000){g=g/100000000000;h="TB"}else{if(g>=100000000){g=g/100000000;h="GB"}else{if(g>=100000){g=g/100000;h="MB"}else{if(g>=100){g=g/100;h="KB"}else{g=g*10;h="b"}}}}return(Math.round(g)/10)+h},selectAll:function(h){var g=h.target.checked;that=this;$(":checkbox","#folder_list_body").each(function(){this.checked=g;$row=$(this.parentElement.parentElement);if(g){that.makeDarkRow($row)}else{that.makeWhiteRow($row)}})},selectClickedRow:function(h){var j="";var g;var i;if(h.target.localName==="input"){j=h.target;g=$(h.target.parentElement.parentElement);i="input"}else{if(h.target.localName==="td"){j=$("#"+h.target.parentElement.id).find(":checkbox")[0];g=$(h.target.parentElement);i="td"}}if(j.checked){if(i==="td"){j.checked="";this.makeWhiteRow(g)}else{if(i==="input"){this.makeDarkRow(g)}}}else{if(i==="td"){j.checked="selected";this.makeDarkRow(g)}else{if(i==="input"){this.makeWhiteRow(g)}}}},makeDarkRow:function(g){g.removeClass("light");g.find("a").removeClass("light");g.addClass("dark");g.find("a").addClass("dark");g.find("span").removeClass("fa-file-o");g.find("span").addClass("fa-file")},makeWhiteRow:function(g){g.removeClass("dark");g.find("a").removeClass("dark");g.addClass("light");g.find("a").addClass("light");g.find("span").addClass("fa-file-o");g.find("span").removeClass("fa-file")},templateFolder:function(){var g=[];g.push('<ol class="breadcrumb">');g.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');g.push(" <% _.each(path, function(path_item) { %>");g.push(" <% if (path_item[0] != id) { %>");g.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');g.push("<% } else { %>");g.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');g.push(" <% } %>");g.push(" <% }); %>");g.push("</ol>");g.push('<table id="folder_table" class="grid table table-condensed">');g.push(" <thead>");g.push(' <th class="button_heading"></th>');g.push(' <th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');g.push(' <th style="width:30%;"><a class="sort-folder-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');g.push(" <th>data type</th>");g.push(" <th>size</th>");g.push(" <th>time updated (UTC)</th>");g.push(' <th style="width:15%;"></th> ');g.push(" </thead>");g.push(' <tbody id="folder_list_body">');g.push(' <tr id="first_folder_item">');g.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" </tr>");g.push(" </tbody>");g.push("</table>");g.push('<div class="empty-folder-message" style="display:none;">This folder is either empty or you do not have proper access permissions to see the contents.</div>');return _.template(g.join(""))}});return{FolderListView:b}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-folderrow-view"],function(c,e,f,d,a){var b=Backbone.View.extend({el:"#folder_items_element",defaults:{include_deleted:false},progress:0,progressStep:1,modal:null,folderContainer:null,sort:"asc",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .sort-folder-link":"sort_clicked"},rowViews:{},initialize:function(g){this.options=_.defaults(this.options||{},g);this.fetchFolder()},fetchFolder:function(g){var g=g||{};this.options.include_deleted=g.include_deleted;var h=this;this.collection=new d.Folder();this.listenTo(this.collection,"add",this.renderOne);this.listenTo(this.collection,"remove",this.removeOne);this.folderContainer=new d.FolderContainer({id:this.options.id});this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents";if(this.options.include_deleted){this.folderContainer.url=this.folderContainer.url+"?include_deleted=true"}this.folderContainer.fetch({success:function(i){h.folder_container=i;h.render();h.addAll(i.get("folder").models);if(h.options.dataset_id){_.findWhere(h.rowViews,{id:h.options.dataset_id}).showDatasetDetails()}},error:function(j,i){if(typeof i.responseJSON!=="undefined"){f.error(i.responseJSON.err_msg)}else{f.error("An error ocurred :(")}}})},render:function(g){this.options=_.defaults(this.options,g);var h=this.templateFolder();var i=this.folderContainer.attributes.metadata.full_path;var j;if(i.length===1){j=0}else{j=i[i.length-2][0]}this.$el.html(h({path:this.folderContainer.attributes.metadata.full_path,id:this.options.id,upper_folder_id:j,order:this.sort}));$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},postRender:function(){var g=this.folderContainer.attributes.metadata;g.contains_file=typeof this.collection.findWhere({type:"file"})!=="undefined";Galaxy.libraries.folderToolbarView.configureElements(g);$(".deleted_dataset").hover(function(){$(this).find(".show_on_hover").show()},function(){$(this).find(".show_on_hover").hide()})},addAll:function(g){_.each(g.reverse(),function(h){Galaxy.libraries.folderListView.collection.add(h)});$("#center [data-toggle]").tooltip();this.checkEmptiness();this.postRender()},renderAll:function(){var g=this;_.each(this.collection.models.reverse(),function(h){g.renderOne(h)});this.postRender()},renderOne:function(h){if(h.get("data_type")!=="folder"){this.options.contains_file=true;h.set("readable_size",this.size_to_string(h.get("file_size")))}h.set("folder_id",this.id);var g=new a.FolderRowView(h);this.rowViews[h.get("id")]=g;this.$el.find("#first_folder_item").after(g.el);$(".deleted_dataset").hover(function(){$(this).find(".show_on_hover").show()},function(){$(this).find(".show_on_hover").hide()})},removeOne:function(g){this.$el.find("#"+g.id).remove()},checkEmptiness:function(){if((this.$el.find(".dataset_row").length===0)&&(this.$el.find(".folder_row").length===0)){this.$el.find(".empty-folder-message").show()}else{this.$el.find(".empty-folder-message").hide()}},sort_clicked:function(g){g.preventDefault();if(this.sort==="asc"){this.sortFolder("name","desc");this.sort="desc"}else{this.sortFolder("name","asc");this.sort="asc"}this.render();this.renderAll()},sortFolder:function(h,g){if(h==="name"){if(g==="asc"){return this.collection.sortByNameAsc()}else{if(g==="desc"){return this.collection.sortByNameDesc()}}}},size_to_string:function(g){var h="";if(g>=100000000000){g=g/100000000000;h="TB"}else{if(g>=100000000){g=g/100000000;h="GB"}else{if(g>=100000){g=g/100000;h="MB"}else{if(g>=100){g=g/100;h="KB"}else{g=g*10;h="b"}}}}return(Math.round(g)/10)+h},selectAll:function(h){var g=h.target.checked;that=this;$(":checkbox","#folder_list_body").each(function(){this.checked=g;$row=$(this.parentElement.parentElement);if(g){that.makeDarkRow($row)}else{that.makeWhiteRow($row)}})},selectClickedRow:function(h){var j="";var g;var i;if(h.target.localName==="input"){j=h.target;g=$(h.target.parentElement.parentElement);i="input"}else{if(h.target.localName==="td"){j=$("#"+h.target.parentElement.id).find(":checkbox")[0];g=$(h.target.parentElement);i="td"}}if(j.checked){if(i==="td"){j.checked="";this.makeWhiteRow(g)}else{if(i==="input"){this.makeDarkRow(g)}}}else{if(i==="td"){j.checked="selected";this.makeDarkRow(g)}else{if(i==="input"){this.makeWhiteRow(g)}}}},makeDarkRow:function(g){g.removeClass("light");g.find("a").removeClass("light");g.addClass("dark");g.find("a").addClass("dark");g.find("span").removeClass("fa-file-o");g.find("span").addClass("fa-file")},makeWhiteRow:function(g){g.removeClass("dark");g.find("a").removeClass("dark");g.addClass("light");g.find("a").addClass("light");g.find("span").addClass("fa-file-o");g.find("span").removeClass("fa-file")},templateFolder:function(){var g=[];g.push('<ol class="breadcrumb">');g.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');g.push(" <% _.each(path, function(path_item) { %>");g.push(" <% if (path_item[0] != id) { %>");g.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');g.push("<% } else { %>");g.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');g.push(" <% } %>");g.push(" <% }); %>");g.push("</ol>");g.push('<table id="folder_table" class="grid table table-condensed">');g.push(" <thead>");g.push(' <th class="button_heading"></th>');g.push(' <th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');g.push(' <th style="width:30%;"><a class="sort-folder-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');g.push(" <th>data type</th>");g.push(" <th>size</th>");g.push(" <th>time updated (UTC)</th>");g.push(' <th style="width:15%;"></th> ');g.push(" </thead>");g.push(' <tbody id="folder_list_body">');g.push(' <tr id="first_folder_item">');g.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" </tr>");g.push(" </tbody>");g.push("</table>");g.push('<div class="empty-folder-message" style="display:none;">This folder is either empty or you do not have proper access permissions to see the contents.</div>');return _.template(g.join(""))}});return{FolderListView:b}});
\ No newline at end of file
diff -r b852505038a8c3a05d0320ad7d00dccf7969a864 -r 9dd03d95b91c22c1a35aa6328e2d7261705fe454 static/scripts/packed/mvc/library/library-folderrow-view.js
--- a/static/scripts/packed/mvc/library/library-folderrow-view.js
+++ b/static/scripts/packed/mvc/library/library-folderrow-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({lastSelectedHistory:"",events:{"click .library-dataset":"showDatasetDetails","click .undelete_dataset_btn":"undelete_dataset"},options:{type:null},initialize:function(f){this.render(f)},render:function(f){var g=null;if(f.get("type")==="folder"){this.options.type="folder";g=this.templateRowFolder()}else{this.options.type="file";if(f.get("deleted")){g=this.templateRowDeletedFile()}else{g=this.templateRowFile()}}this.setElement(g({content_item:f}));this.$el.show();return this},showDatasetDetails:function(i){i.preventDefault();var j=this.id;var h=new c.Item();var g=new c.GalaxyHistories();h.id=j;var f=this;h.fetch({success:function(k){g.fetch({success:function(l){f.renderModalAfterFetch(k,l)},error:function(m,l){if(typeof l.responseJSON!=="undefined"){e.error(l.responseJSON.err_msg)}else{e.error("An error occured during fetching histories:(")}f.renderModalAfterFetch(k)}})},error:function(l,k){if(typeof k.responseJSON!=="undefined"){e.error(k.responseJSON.err_msg)}else{e.error("An error occured during loading dataset details :(")}}})},renderModalAfterFetch:function(k,h){var i=this.size_to_string(k.get("file_size"));var j=_.template(this.templateDatasetModal(),{item:k,size:i});var g=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Dataset Details",body:j,buttons:{Import:function(){g.importCurrentIntoHistory()},Download:function(){g.downloadCurrent()},Close:function(){g.modal.hide()}}});$(".peek").html(k.get("peek"));if(typeof history.models!==undefined){var f=_.template(this.templateHistorySelectInModal(),{histories:h.models});$(this.modal.elMain).find(".buttons").prepend(f);if(g.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(g.lastSelectedHistory)}}},size_to_string:function(f){var g="";if(f>=100000000000){f=f/100000000000;g="TB"}else{if(f>=100000000){f=f/100000000;g="GB"}else{if(f>=100000){f=f/100000;g="MB"}else{if(f>=100){f=f/100;g="KB"}else{f=f*10;g="b"}}}}return(Math.round(f)/10)+g},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var f=[];f.push($("#id_row").attr("data-id"));var g="/api/libraries/datasets/download/uncompressed";var h={ldda_ids:f};this.processDownload(g,h);this.modal.enableButton("Import");this.modal.enableButton("Download")},processDownload:function(g,h,i){if(g&&h){h=typeof h=="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var h=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=h;var f=$("#id_row").attr("data-id");var i=new c.HistoryItem();var g=this;i.url=i.urlRoot+h+"/contents";i.save({content:f,source:"library"},{success:function(){e.success("Dataset imported");g.modal.enableButton("Import");g.modal.enableButton("Download")},error:function(k,j){if(typeof j.responseJSON!=="undefined"){e.error("Dataset not imported. "+j.responseJSON.err_msg)}else{e.error("An error occured! Dataset not imported. Please try again.")}g.modal.enableButton("Import");g.modal.enableButton("Download")}})},undelete_dataset:function(g){$(".tooltip").hide();var f=$(g.target).closest("tr")[0].id;var h=Galaxy.libraries.folderListView.collection.get(f);h.url=h.urlRoot+h.id+"?undelete=true";h.destroy({success:function(j,i){Galaxy.libraries.folderListView.collection.remove(f);var k=new c.Item(i);Galaxy.libraries.folderListView.collection.add(k);e.success("Dataset undeleted")},error:function(j,i){if(typeof i.responseJSON!=="undefined"){e.error("Dataset was not undeleted. "+i.responseJSON.err_msg)}else{e.error("An error occured! Dataset was not undeleted. Please try again.")}}})},templateRowFolder:function(){tmpl_array=[];tmpl_array.push('<tr class="folder_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Folder" class="fa fa-folder-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(" <td></td>");tmpl_array.push(" <td>");tmpl_array.push(' <a href="#folders/<%- content_item.id %>"><%- content_item.get("name") %></a>');tmpl_array.push(' <% if (content_item.get("item_count") === 0) { %>');tmpl_array.push(" <span>(empty folder)</span>");tmpl_array.push(" <% } %>");tmpl_array.push(" </td>");tmpl_array.push(" <td>folder</td>");tmpl_array.push(" <td></td>");tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(" <td></td>");tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowFile:function(){tmpl_array=[];tmpl_array.push('<tr class="dataset_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');tmpl_array.push(' <td><a href="#" class="library-dataset"><%- content_item.get("name") %><a></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(" <td></td>");tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowDeletedFile:function(){tmpl_array=[];tmpl_array.push('<tr class="active deleted_dataset" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td><span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"></span></td>');tmpl_array.push(' <td style="color:grey;"><%- content_item.get("name") %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(' <td class="right-center"><button data-toggle="tooltip" data-placement="top" title="Undelete <%- content_item.get("name") %>" class="primary-button btn-xs undelete_dataset_btn show_on_hover" type="button" style="display:none;"><span class="fa fa-unlock"> Undelete</span></button></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateDatasetModal:function(){var f=[];f.push('<div class="modal_table">');f.push(' <table class="grid table table-striped table-condensed">');f.push(" <tr>");f.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');f.push(' <td><%= _.escape(item.get("name")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Data type</th>');f.push(' <td><%= _.escape(item.get("data_type")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Genome build</th>');f.push(' <td><%= _.escape(item.get("genome_build")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Size</th>');f.push(" <td><%= _.escape(size) %></td>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Date uploaded (UTC)</th>');f.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Uploaded by</th>');f.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');f.push(" </tr>");f.push(' <tr scope="row">');f.push(' <th scope="row">Data Lines</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Comment Lines</th>');f.push(' <% if (item.get("metadata_comment_lines") === "") { %>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');f.push(" <% } else { %>");f.push(' <td scope="row">unknown</td>');f.push(" <% } %>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Number of Columns</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Column Types</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Miscellaneous information</th>');f.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');f.push(" </tr>");f.push(" </table>");f.push(' <pre class="peek">');f.push(" </pre>");f.push("</div>");return f.join("")},templateHistorySelectInModal:function(){var f=[];f.push('<span id="history_modal_combo" style="width:100%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_single" name="dataset_import_single" style="width:40%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return f.join("")}});return{FolderRowView:a}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({lastSelectedHistory:"",events:{"click .undelete_dataset_btn":"undelete_dataset"},options:{type:null},initialize:function(f){this.render(f)},render:function(f){var g=null;if(f.get("type")==="folder"){this.options.type="folder";g=this.templateRowFolder()}else{this.options.type="file";if(f.get("deleted")){g=this.templateRowDeletedFile()}else{g=this.templateRowFile()}}this.setElement(g({content_item:f}));this.$el.show();return this},showDatasetDetails:function(){var i=this.id;var h=new c.Item();var g=new c.GalaxyHistories();h.id=i;var f=this;h.fetch({success:function(j){g.fetch({success:function(k){f.renderModalAfterFetch(j,k)},error:function(l,k){if(typeof k.responseJSON!=="undefined"){e.error(k.responseJSON.err_msg)}else{e.error("An error occured during fetching histories:(")}f.renderModalAfterFetch(j)}})},error:function(k,j){if(typeof j.responseJSON!=="undefined"){e.error(j.responseJSON.err_msg)}else{e.error("An error occured during loading dataset details :(")}}})},renderModalAfterFetch:function(k,h){var i=this.size_to_string(k.get("file_size"));var j=_.template(this.templateDatasetModal(),{item:k,size:i});var g=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Dataset Details",body:j,buttons:{Import:function(){g.importCurrentIntoHistory()},Download:function(){g.downloadCurrent()},Close:function(){g.modal.hide()}}});$(".peek").html(k.get("peek"));if(typeof history.models!==undefined){var f=_.template(this.templateHistorySelectInModal(),{histories:h.models});$(this.modal.elMain).find(".buttons").prepend(f);if(g.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(g.lastSelectedHistory)}}},size_to_string:function(f){var g="";if(f>=100000000000){f=f/100000000000;g="TB"}else{if(f>=100000000){f=f/100000000;g="GB"}else{if(f>=100000){f=f/100000;g="MB"}else{if(f>=100){f=f/100;g="KB"}else{f=f*10;g="b"}}}}return(Math.round(f)/10)+g},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var f=[];f.push($("#id_row").attr("data-id"));var g="/api/libraries/datasets/download/uncompressed";var h={ldda_ids:f};this.processDownload(g,h);this.modal.enableButton("Import");this.modal.enableButton("Download")},processDownload:function(g,h,i){if(g&&h){h=typeof h=="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var h=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=h;var f=$("#id_row").attr("data-id");var i=new c.HistoryItem();var g=this;i.url=i.urlRoot+h+"/contents";i.save({content:f,source:"library"},{success:function(){e.success("Dataset imported");g.modal.enableButton("Import");g.modal.enableButton("Download")},error:function(k,j){if(typeof j.responseJSON!=="undefined"){e.error("Dataset not imported. "+j.responseJSON.err_msg)}else{e.error("An error occured! Dataset not imported. Please try again.")}g.modal.enableButton("Import");g.modal.enableButton("Download")}})},undelete_dataset:function(g){$(".tooltip").hide();var f=$(g.target).closest("tr")[0].id;var h=Galaxy.libraries.folderListView.collection.get(f);h.url=h.urlRoot+h.id+"?undelete=true";h.destroy({success:function(j,i){Galaxy.libraries.folderListView.collection.remove(f);var k=new c.Item(i);Galaxy.libraries.folderListView.collection.add(k);e.success("Dataset undeleted")},error:function(j,i){if(typeof i.responseJSON!=="undefined"){e.error("Dataset was not undeleted. "+i.responseJSON.err_msg)}else{e.error("An error occured! Dataset was not undeleted. Please try again.")}}})},templateRowFolder:function(){tmpl_array=[];tmpl_array.push('<tr class="folder_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Folder" class="fa fa-folder-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(" <td></td>");tmpl_array.push(" <td>");tmpl_array.push(' <a href="#folders/<%- content_item.id %>"><%- content_item.get("name") %></a>');tmpl_array.push(' <% if (content_item.get("item_count") === 0) { %>');tmpl_array.push(" <span>(empty folder)</span>");tmpl_array.push(" <% } %>");tmpl_array.push(" </td>");tmpl_array.push(" <td>folder</td>");tmpl_array.push(" <td></td>");tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(" <td></td>");tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowFile:function(){tmpl_array=[];tmpl_array.push('<tr class="dataset_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');tmpl_array.push(' <td><a href="#folders/<%- content_item.get("folder_id") %>/datasets/<%- content_item.id %>" class="library-dataset"><%- content_item.get("name") %><a></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(" <td></td>");tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowDeletedFile:function(){tmpl_array=[];tmpl_array.push('<tr class="active deleted_dataset" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td><span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"></span></td>');tmpl_array.push(' <td style="color:grey;"><%- content_item.get("name") %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push(' <td class="right-center"><button data-toggle="tooltip" data-placement="top" title="Undelete <%- content_item.get("name") %>" class="primary-button btn-xs undelete_dataset_btn show_on_hover" type="button" style="display:none;"><span class="fa fa-unlock"> Undelete</span></button></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateDatasetModal:function(){var f=[];f.push('<div class="modal_table">');f.push(' <table class="grid table table-striped table-condensed">');f.push(" <tr>");f.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');f.push(' <td><%= _.escape(item.get("name")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Data type</th>');f.push(' <td><%= _.escape(item.get("data_type")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Genome build</th>');f.push(' <td><%= _.escape(item.get("genome_build")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Size</th>');f.push(" <td><%= _.escape(size) %></td>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Date uploaded (UTC)</th>');f.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Uploaded by</th>');f.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');f.push(" </tr>");f.push(' <tr scope="row">');f.push(' <th scope="row">Data Lines</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Comment Lines</th>');f.push(' <% if (item.get("metadata_comment_lines") === "") { %>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');f.push(" <% } else { %>");f.push(' <td scope="row">unknown</td>');f.push(" <% } %>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Number of Columns</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Column Types</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Miscellaneous information</th>');f.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');f.push(" </tr>");f.push(" </table>");f.push(' <pre class="peek">');f.push(" </pre>");f.push("</div>");return f.join("")},templateHistorySelectInModal:function(){var f=[];f.push('<span id="history_modal_combo" style="width:100%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_single" name="dataset_import_single" style="width:40%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return f.join("")}});return{FolderRowView:a}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: Jeremy Goecks: Put converted datasets in history and add note to merge copied converter code.
by commits-noreply@bitbucket.org 02 May '14
by commits-noreply@bitbucket.org 02 May '14
02 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b852505038a8/
Changeset: b852505038a8
User: Jeremy Goecks
Date: 2014-05-02 22:32:38
Summary: Put converted datasets in history and add note to merge copied converter code.
Affected #: 2 files
diff -r 41bb60076082ea46686a4bb9db8cb593b8f35851 -r b852505038a8c3a05d0320ad7d00dccf7969a864 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1564,8 +1564,7 @@
raise NoConverterException("A dependency (%s) is missing a converter." % dependency)
except KeyError:
pass # No deps
- new_dataset = self.datatype.convert_dataset( trans, self, target_ext, return_output=True, visible=False, deps=deps, set_output_history=False ).values()[0]
- new_dataset.name = self.name
+ new_dataset = self.datatype.convert_dataset( trans, self, target_ext, return_output=True, visible=False, deps=deps, set_output_history=True ).values()[0]
assoc = ImplicitlyConvertedDatasetAssociation( parent=self, file_type=target_ext, dataset=new_dataset, metadata_safe=False )
session = trans.sa_session
session.add( new_dataset )
diff -r 41bb60076082ea46686a4bb9db8cb593b8f35851 -r b852505038a8c3a05d0320ad7d00dccf7969a864 lib/galaxy/tools/actions/__init__.py
--- a/lib/galaxy/tools/actions/__init__.py
+++ b/lib/galaxy/tools/actions/__init__.py
@@ -50,6 +50,7 @@
if converted_dataset:
data = converted_dataset
else:
+ # FIXME: merge with hda.get_converted_dataset() mode as it's nearly identical.
#run converter here
new_data = data.datatype.convert_dataset( trans, data, target_ext, return_output=True, visible=False ).values()[0]
new_data.hid = data.hid
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
02 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/41bb60076082/
Changeset: 41bb60076082
User: devteam
Date: 2014-05-02 21:55:45
Summary: Enhance the framework that supports discovery of tool dependencies' scripts that are in the same repository as the tool. This eliminates the requirement for setting a variable _SCRIPT_PATH in the tool_dependencies.xml and requirements tagset in a tool config. Now it only needs to be set in the tool config and it should look like: <requirement type="set_environment">PATH</requirement>
Affected #: 5 files
diff -r 2f79c07c4438b627df03aa3f96dcd51f8b12c641 -r 41bb60076082ea46686a4bb9db8cb593b8f35851 lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
@@ -289,6 +289,55 @@
raise Exception( message )
return handled_tool_dependencies
+def handle_env_vars_for_set_environment_tool_dependency( app, tool_shed_repository, tool_shed_repository_install_dir ):
+ env_var_name = 'PATH'
+ install_dir = \
+ tool_dependency_util.get_tool_dependency_install_dir( app=app,
+ repository_name=tool_shed_repository.name,
+ repository_owner=tool_shed_repository.owner,
+ repository_changeset_revision=tool_shed_repository.installed_changeset_revision,
+ tool_dependency_type='set_environment',
+ tool_dependency_name=env_var_name,
+ tool_dependency_version=None )
+ env_var_dict = dict( name=env_var_name, action='prepend_to', value=tool_shed_repository_install_dir )
+ if not os.path.exists( install_dir ):
+ os.makedirs( install_dir )
+ status = app.install_model.ToolDependency.installation_status.INSTALLING
+ tool_dependency = \
+ tool_dependency_util.create_or_update_tool_dependency( app=app,
+ tool_shed_repository=tool_shed_repository,
+ name=env_var_name,
+ version=None,
+ type='set_environment',
+ status=status,
+ set_status=True )
+ env_file_builder = EnvFileBuilder( install_dir )
+ return_code = env_file_builder.append_line( make_executable=True, **env_var_dict )
+ if return_code:
+ error_message = 'Error creating env.sh file for tool dependency %s, return_code: %s' % \
+ ( str( tool_dependency.name ), str( return_code ) )
+ log.debug( error_message )
+ status = app.install_model.ToolDependency.installation_status.ERROR
+ tool_dependency = \
+ tool_dependency_util.set_tool_dependency_attributes( app,
+ tool_dependency=tool_dependency,
+ status=status,
+ error_message=error_message,
+ remove_from_disk=False )
+ else:
+ if tool_dependency.status not in [ app.install_model.ToolDependency.installation_status.ERROR,
+ app.install_model.ToolDependency.installation_status.INSTALLED ]:
+ status = app.install_model.ToolDependency.installation_status.INSTALLED
+ tool_dependency = \
+ tool_dependency_util.set_tool_dependency_attributes( app,
+ tool_dependency=tool_dependency,
+ status=status,
+ error_message=None,
+ remove_from_disk=False )
+ log.debug( 'Environment variable %s set in %s for tool dependency %s.' % \
+ ( str( env_var_name ), str( install_dir ), str( tool_dependency.name ) ) )
+ return tool_dependency
+
def install_and_build_package_via_fabric( app, tool_shed_repository, tool_dependency, actions_dict ):
sa_session = app.install_model.context
try:
@@ -638,12 +687,20 @@
"""
# TODO: Add support for a repository dependency definition within this tool dependency type's tag set. This should look something like
# the following. See the implementation of support for this in the tool dependency package type's method above.
+ # This function is only called for set environment actions as defined below, not within an <install version="1.0"> tool
+ # dependency type. Here is an example of the tag set this function does handle:
+ # <action type="set_environment">
+ # <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR</environment_variable>
+ # </action>
+ # Here is an example of the tag set this function does not handle:
# <set_environment version="1.0">
# <repository toolshed="<tool shed>" name="<repository name>" owner="<repository owner>" changeset_revision="<changeset revision>" />
# </set_environment>
sa_session = app.install_model.context
- tool_dependency = None
+ tool_dependencies = []
env_var_version = elem.get( 'version', '1.0' )
+ tool_shed_repository_install_dir = fabric_util.get_tool_shed_repository_install_dir( app, tool_shed_repository )
+ tool_shed_repository_install_dir_added_to_path = False
for env_var_elem in elem:
# Althoug we're in a loop here, this method will always return only a single ToolDependency or None.
env_var_name = env_var_elem.get( 'name', None )
@@ -662,10 +719,10 @@
tool_dependency_type='set_environment',
tool_dependency_name=env_var_name,
tool_dependency_version=None )
- tool_shed_repository_install_dir = fabric_util.get_tool_shed_repository_install_dir( app, tool_shed_repository )
+ install_environment = InstallEnvironment( tool_shed_repository_install_dir=tool_shed_repository_install_dir,
+ install_dir=install_dir )
env_var_dict = td_common_util.create_env_var_dict( elem=env_var_elem,
- tool_dependency_install_dir=install_dir,
- tool_shed_repository_install_dir=tool_shed_repository_install_dir )
+ install_environment=install_environment )
if env_var_dict:
if not os.path.exists( install_dir ):
os.makedirs( install_dir )
@@ -714,7 +771,18 @@
status=status,
error_message=error_message,
remove_from_disk=False )
- return tool_dependency
+ if tool_dependency.status != app.install_model.ToolDependency.installation_status.ERROR:
+ if env_var_dict[ 'name' ] == 'PATH' and \
+ env_var_dict[ 'action' ] in [ 'prepend_to', 'set_to', 'append_to' ] and \
+ env_var_dict[ 'value' ] == install_environment.tool_shed_repository_install_dir:
+ tool_shed_repository_install_dir_added_to_path = True
+ tool_dependencies.append( tool_dependency )
+ if not tool_shed_repository_install_dir_added_to_path:
+ tool_dependency = handle_env_vars_for_set_environment_tool_dependency( app,
+ tool_shed_repository,
+ tool_shed_repository_install_dir )
+ tool_dependencies.append( tool_dependency )
+ return tool_dependencies
def strip_path( fpath ):
if not fpath:
diff -r 2f79c07c4438b627df03aa3f96dcd51f8b12c641 -r 41bb60076082ea46686a4bb9db8cb593b8f35851 lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
@@ -707,17 +707,22 @@
return env_var_dict
def prepare_step( self, app, tool_dependency, action_elem, action_dict, install_environment, is_binary_download ):
+ # This function is only called for set environment actions as defined above, not within a <set_environment> tool
+ # dependency type. Here is an example of the tag set this function does handle:
# <action type="set_environment">
# <environment_variable name="PYTHONPATH" action="append_to">$INSTALL_DIR/lib/python</environment_variable>
# <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/bin</environment_variable>
# </action>
+ # Here is an example of the tag set this function does not handle:
+ # <action type="set_environment">
+ # <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR</environment_variable>
+ # </action>
env_var_dicts = []
for env_elem in action_elem:
if env_elem.tag == 'environment_variable':
env_var_dict = \
td_common_util.create_env_var_dict( elem=env_elem,
- tool_dependency_install_dir=install_environment.install_dir,
- tool_shed_repository_install_dir=install_environment.tool_shed_repository_install_dir )
+ install_environment=install_environment )
if env_var_dict:
env_var_dicts.append( env_var_dict )
if env_var_dicts:
diff -r 2f79c07c4438b627df03aa3f96dcd51f8b12c641 -r 41bb60076082ea46686a4bb9db8cb593b8f35851 lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py
@@ -168,10 +168,12 @@
return True
return False
-def create_env_var_dict( elem, tool_dependency_install_dir=None, tool_shed_repository_install_dir=None ):
+def create_env_var_dict( elem, install_environment ):
env_var_name = elem.get( 'name', 'PATH' )
env_var_action = elem.get( 'action', 'prepend_to' )
env_var_text = None
+ tool_dependency_install_dir = install_environment.install_dir
+ tool_shed_repository_install_dir = install_environment.tool_shed_repository_install_dir
if elem.text and elem.text.find( 'REPOSITORY_INSTALL_DIR' ) >= 0:
if tool_shed_repository_install_dir and elem.text.find( '$REPOSITORY_INSTALL_DIR' ) != -1:
env_var_text = elem.text.replace( '$REPOSITORY_INSTALL_DIR', tool_shed_repository_install_dir )
diff -r 2f79c07c4438b627df03aa3f96dcd51f8b12c641 -r 41bb60076082ea46686a4bb9db8cb593b8f35851 lib/tool_shed/util/common_install_util.py
--- a/lib/tool_shed/util/common_install_util.py
+++ b/lib/tool_shed/util/common_install_util.py
@@ -349,9 +349,15 @@
requirement_dict[ 'status' ] = tool_dependency_status
new_val.append( requirement_dict )
if tool_dependency_status in [ trans.install_model.ToolDependency.installation_status.INSTALLED ]:
- installed_tool_dependencies[ td_key ] = new_val
+ if td_key in installed_tool_dependencies:
+ installed_tool_dependencies[ td_key ].extend( new_val )
+ else:
+ installed_tool_dependencies[ td_key ] = new_val
else:
- missing_tool_dependencies[ td_key ] = new_val
+ if td_key in missing_tool_dependencies:
+ missing_tool_dependencies[ td_key ].extend( new_val )
+ else:
+ missing_tool_dependencies[ td_key ] = new_val
else:
# The val dictionary looks something like this:
# {'repository_name': 'xx',
@@ -497,6 +503,7 @@
return installed_tool_dependencies
root = tree.getroot()
fabric_version_checked = False
+ set_environment_handled = False
for elem in root:
if elem.tag == 'package':
# Only install the tool_dependency if it is not already installed and it is associated with a database record in the received
@@ -556,21 +563,31 @@
# <set_environment version="1.0">
# <environment_variable name="R_SCRIPT_PATH"action="set_to">$REPOSITORY_INSTALL_DIR</environment_variable>
# </set_environment>
+ set_environment_handled = True
try:
- tool_dependency = set_environment( app, elem, tool_shed_repository, attr_tups_of_dependencies_for_install )
+ tool_dependencies = set_environment( app, elem, tool_shed_repository, attr_tups_of_dependencies_for_install )
except Exception, e:
error_message = "Error setting environment for tool dependency: %s" % str( e )
log.debug( error_message )
- if tool_dependency:
- # Since there was an installation error, update the tool dependency status to Error. The remove_installation_path option must
- # be left False here.
- tool_dependency = tool_dependency_util.handle_tool_dependency_installation_error( app,
- tool_dependency,
- error_message,
- remove_installation_path=False )
- if tool_dependency and tool_dependency.status in [ app.install_model.ToolDependency.installation_status.INSTALLED,
- app.install_model.ToolDependency.installation_status.ERROR ]:
- installed_tool_dependencies.append( tool_dependency )
+ for tool_dependency in tool_dependencies:
+ if tool_dependency and tool_dependency.status == app.install_model.ToolDependency.installation_status.ERROR:
+ # Since there was an installation error, update the tool dependency status to Error. The remove_installation_path option must
+ # be left False here.
+ tool_dependency = tool_dependency_util.handle_tool_dependency_installation_error( app,
+ tool_dependency,
+ error_message,
+ remove_installation_path=False )
+ for tool_dependency in tool_dependencies:
+ if tool_dependency and tool_dependency.status in [ app.install_model.ToolDependency.installation_status.INSTALLED,
+ app.install_model.ToolDependency.installation_status.ERROR ]:
+ installed_tool_dependencies.append( tool_dependency )
+ if not set_environment_handled:
+ element_attributes = dict( name='PATH', action='prepend_to' )
+ generated_elem = xml_util.create_element( 'environment_variable', attributes=element_attributes, sub_elements=None )
+ generated_elem.text = '$REPOSITORY_INSTALL_DIR'
+ generated_attr_tups = [ ( 'PATH', None, 'set_environment' ) ]
+ tool_dependencies = set_environment( app, generated_elem, tool_shed_repository, generated_attr_tups )
+ installed_tool_dependencies.extend( tool_dependencies )
return installed_tool_dependencies
def repository_dependency_needed_only_for_compiling_tool_dependency( repository, repository_dependency ):
diff -r 2f79c07c4438b627df03aa3f96dcd51f8b12c641 -r 41bb60076082ea46686a4bb9db8cb593b8f35851 lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -23,6 +23,7 @@
from tool_shed.galaxy_install.tool_dependencies import install_util
from tool_shed.galaxy_install.tool_dependencies import td_common_util
import tool_shed.repository_types.util as rt_util
+from xml.etree import ElementTree as XmlET
eggs.require( 'mercurial' )
@@ -921,7 +922,28 @@
invalid_tool_dependencies_dict = {}
valid_repository_dependency_tups = []
invalid_repository_dependency_tups = []
+ needs_set_environment_tool_dependency_for_path = False
+ tools_metadata = metadata_dict.get( 'tools', None )
+ if tools_metadata is not None:
+ for tools_dict in tools_metadata:
+ requirements = tools_dict.get( 'requirements', None )
+ if requirements is not None:
+ for requirements_dict in requirements:
+ if requirements_dict[ 'type' ] == 'set_environment' and requirements_dict[ 'name' ] == 'PATH':
+ needs_set_environment_tool_dependency_for_path = True
+ break
description = root.get( 'description' )
+ if needs_set_environment_tool_dependency_for_path:
+ # Add this to the in-memory XML tree that is parsed to determine the database tool dependency records. This will not
+ # modify the on-disk tool dependency definitions, but is needed in order for the tool to correctly source the env.sh
+ # file that was generated for the PATH variable.
+ # <set_environment version="1.0">
+ # <environment_variable action="prepend_to" name="PATH">$REPOSITORY_INSTALL_DIR</environment_variable>
+ # </set_environment>
+ env_var_elem_attributes = dict( name='PATH', action='prepend_to' )
+ set_environment_elem = xml_util.create_element( 'set_environment', attributes=dict( version='1.0' ) )
+ XmlET.SubElement( set_environment_elem, 'environment_variable', attrib=env_var_elem_attributes )
+ root.append( set_environment_elem )
for elem in root:
if elem.tag == 'package':
valid_tool_dependencies_dict, invalid_tool_dependencies_dict, repository_dependency_tup, repository_dependency_is_valid, message = \
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: carlfeberhard: History: cruft removal from controller and associated javascript
by commits-noreply@bitbucket.org 02 May '14
by commits-noreply@bitbucket.org 02 May '14
02 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2f79c07c4438/
Changeset: 2f79c07c4438
User: carlfeberhard
Date: 2014-05-02 21:45:25
Summary: History: cruft removal from controller and associated javascript
Affected #: 3 files
diff -r 3f8e4852623187152ffaea5fd529fac2001c8316 -r 2f79c07c4438b627df03aa3f96dcd51f8b12c641 lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -549,6 +549,7 @@
count += 1
return trans.show_ok_message( "%d datasets have been deleted permanently" % count, refresh_frames=['history'] )
+ #TODO: use api instead
@web.expose
def delete_current( self, trans, purge=False ):
"""Delete just the active history -- this does not require a logged in user."""
@@ -604,6 +605,7 @@
trans.sa_session.add( history )
trans.sa_session.flush()
return trans.show_ok_message( "Your datasets have been unhidden.", refresh_frames=refresh_frames )
+ #TODO: used in index.mako
@web.expose
def resume_paused_jobs( self, trans, current=False, ids=None ):
@@ -618,6 +620,7 @@
trans.sa_session.add( history )
trans.sa_session.flush()
return trans.show_ok_message( "Your jobs have been resumed.", refresh_frames=refresh_frames )
+ #TODO: used in index.mako
@web.expose
@web.require_login( "rate items" )
@@ -630,34 +633,7 @@
# Rate history.
history_rating = self.rate_item( trans.sa_session, trans.get_user(), history, rating )
return self.get_ave_item_rating_data( trans.sa_session, history )
-
- @web.expose
- def rename_async( self, trans, id=None, new_name=None ):
- history = self.get_history( trans, id )
- # Check that the history exists, and is either owned by the current
- # user (if logged in) or the current history
- assert history is not None
- if history.user is None:
- assert history == trans.get_history()
- else:
- assert history.user == trans.user
- # Rename
- new_name = sanitize_html( new_name )
- history.name = new_name
- trans.sa_session.add( history )
- trans.sa_session.flush()
- return new_name
-
- @web.expose
- @web.require_login( "use Galaxy histories" )
- def annotate_async( self, trans, id, new_annotation=None, **kwargs ):
- history = self.get_history( trans, id )
- if new_annotation:
- # Sanitize annotation before adding it.
- new_annotation = sanitize_html( new_annotation, 'utf-8', 'text/html' )
- self.add_item_annotation( trans.sa_session, trans.get_user(), history, new_annotation )
- trans.sa_session.flush()
- return new_annotation
+ #TODO: used in display_base.mako
@web.expose
# TODO: Remove require_login when users are warned that, if they are not
@@ -686,6 +662,7 @@
self.queue_history_import( trans, archive_type=archive_type, archive_source=archive_source )
return trans.show_message( "Importing history from '%s'. \
This history will be visible when the import is complete" % archive_source )
+ #TODO: used in this file and index.mako
@web.expose
def export_archive( self, trans, id=None, gzip=True, include_hidden=False, include_deleted=False ):
@@ -719,6 +696,7 @@
return trans.show_message( "Exporting History '%(n)s'. Use this link to download \
the archive or import it to another Galaxy server: \
<a href='%(u)s'>%(u)s</a>" % ( { 'n' : history.name, 'u' : url } ) )
+ #TODO: used in this file and index.mako
@web.expose
@web.json
@@ -733,6 +711,7 @@
"link" : url_for(controller='history', action="display_by_username_and_slug",
username=history.user.username, slug=history.slug ) }
return return_dict
+ #TODO: used in page/editor.mako
@web.expose
@web.require_login( "set history's accessible flag" )
@@ -748,6 +727,7 @@
history.importable = importable
trans.sa_session.flush()
return
+ #TODO: used in page/editor.mako
@web.expose
def get_item_content_async( self, trans, id ):
@@ -764,6 +744,7 @@
for dataset in datasets:
dataset.annotation = self.get_item_annotation_str( trans.sa_session, history.user, dataset )
return trans.stream_template_mako( "/history/item_content.mako", item = history, item_data = datasets )
+ #TODO: used in embed_base.mako
@web.expose
def name_autocomplete_data( self, trans, q=None, limit=None, timestamp=None ):
@@ -773,9 +754,12 @@
return
ac_data = ""
- for history in trans.sa_session.query( model.History ).filter_by( user=user ).filter( func.lower( model.History.name ) .like(q.lower() + "%") ):
+ for history in ( trans.sa_session.query( model.History )
+ .filter_by( user=user )
+ .filter( func.lower( model.History.name ).like(q.lower() + "%") ) ):
ac_data = ac_data + history.name + "\n"
return ac_data
+ #TODO: used in grid_base.mako
@web.expose
def imp( self, trans, id=None, confirm=False, **kwd ):
@@ -852,6 +836,7 @@
Warning! If you import this history, you will lose your current
history. <br>You can <a href="%s">continue and import this history</a> or %s.
""" % ( web.url_for(controller='history', action='imp', id=id, confirm=True, referer=trans.request.referer ), referer_message ), use_panels=True )
+ #TODO: used in history/view, display, embed
@web.expose
def view( self, trans, id=None, show_deleted=False, show_hidden=False, use_panels=True ):
@@ -1390,51 +1375,4 @@
def get_item( self, trans, id ):
return self.get_history( trans, id )
-
- @web.json
- def get_display_application_links( self, trans, hda_ids=None ):
- """
- Returns external display application JSON data for all/given
- HDAs within the current history.
- """
- #TODO: fold into API and remove
- try:
- history = trans.get_history()
- #TODO: allow id for more flexibility? (the following doesn't work if anonymous...)
- #history = self.get_history( trans, id, check_ownership=True, check_accessible=True, deleted=None )
- if hda_ids:
- unencoded_hda_ids = [ trans.security.decode_id( hda_id ) for hda_id in galaxy.util.listify( hda_ids ) ]
- #TODO: this gets all - should narrow query by using hda_ids here - no way with this current method
- hdas = self.get_history_datasets( trans, history, show_deleted=False, show_hidden=True, show_purged=False )
-
- except Exception, exc:
- log.error( 'Failed loading data for ids (%s): %s', hda_ids, str( exc ), exc_info=True )
- trans.response.status = 500
- return str( exc )
-
- hda_display_links = []
- for hda in hdas:
- # only get requested hdas
- if hda_ids and hda.id not in unencoded_hda_ids:
- continue
-
- hda_link_data = { 'id': trans.security.encode_id( hda.id ) }
- # don't bail on entire list if one hda has an error; record and move on
- try:
- # 'old style': must be enabled in config (see universe_wsgi.ini)
- if trans.app.config.enable_old_display_applications:
- hda_link_data[ 'display_types' ] = self.get_old_display_applications( trans, hda )
-
- # 'new style'
- hda_link_data[ 'display_apps' ] = self.get_display_apps( trans, hda )
-
- except Exception, exc:
- log.error( 'Failed getting links, hda (%s): %s', hda_link_data[ 'id' ], str( exc ), exc_info=True )
- hda_link_data[ 'error' ] = str( exc )
-
- hda_display_links.append( hda_link_data )
-
- # send 'do not cache' headers to handle IE's caching of ajax get responses
- trans.response.headers[ 'Cache-Control' ] = "max-age=0,no-cache,no-store"
- trans.response.set_content_type( 'application/json' )
- return hda_display_links
+ #TODO: override of base ui controller?
diff -r 3f8e4852623187152ffaea5fd529fac2001c8316 -r 2f79c07c4438b627df03aa3f96dcd51f8b12c641 static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -34,26 +34,6 @@
// ........................................................................ urls
urlRoot: galaxy_config.root + 'api/histories',
- /** url for changing the name of the history */
- renameUrl : function(){
-//TODO: just use this.save()
- var id = this.get( 'id' );
- if( !id ){ return undefined; }
- return galaxy_config.root + 'history/rename_async?id=' + this.get( 'id' );
- },
- /** url for changing the annotation of the history */
- annotateUrl : function(){
- var id = this.get( 'id' );
- if( !id ){ return undefined; }
- return galaxy_config.root + 'history/annotate_async?id=' + this.get( 'id' );
- },
- /** url for changing the tags of the history */
- tagUrl : function(){
- var id = this.get( 'id' );
- if( !id ){ return undefined; }
- return galaxy_config.root + 'tag/get_tagging_elt_async?item_id=' + this.get( 'id' ) + '&item_class=History';
- },
-
// ........................................................................ set up/tear down
/** Set up the model
* @param {Object} historyJSON model data for this History
diff -r 3f8e4852623187152ffaea5fd529fac2001c8316 -r 2f79c07c4438b627df03aa3f96dcd51f8b12c641 static/scripts/packed/mvc/history/history-model.js
--- a/static/scripts/packed/mvc/history/history-model.js
+++ b/static/scripts/packed/mvc/history/history-model.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/base-mvc","utils/localization"],function(c,a,b){var e=Backbone.Model.extend(a.LoggableMixin).extend({defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:false},urlRoot:galaxy_config.root+"api/histories",renameUrl:function(){var g=this.get("id");if(!g){return undefined}return galaxy_config.root+"history/rename_async?id="+this.get("id")},annotateUrl:function(){var g=this.get("id");if(!g){return undefined}return galaxy_config.root+"history/annotate_async?id="+this.get("id")},tagUrl:function(){var g=this.get("id");if(!g){return undefined}return galaxy_config.root+"tag/get_tagging_elt_async?item_id="+this.get("id")+"&item_class=History"},initialize:function(h,i,g){g=g||{};this.logger=g.logger||null;this.log(this+".initialize:",h,i,g);this.hdas=new c.HDACollection(i||[],{historyId:this.get("id")});if(i&&_.isArray(i)){this.hdas.reset(i)}this._setUpListeners();this.updateTimeoutId=null},_setUpListeners:function(){this.on("error",function(h,k,g,j,i){this.errorHandler(h,k,g,j,i)});if(this.hdas){this.listenTo(this.hdas,"error",function(){this.trigger.apply(this,["error:hdas"].concat(jQuery.makeArray(arguments)))})}this.on("change:id",function(h,g){if(this.hdas){this.hdas.historyId=g}},this)},errorHandler:function(h,k,g,j,i){this.clearUpdateTimeout()},ownedByCurrUser:function(){if(!Galaxy||!Galaxy.currUser){return false}if(Galaxy.currUser.isAnonymous()||Galaxy.currUser.id!==this.get("user_id")){return false}return true},hdaCount:function(){return _.reduce(_.values(this.get("state_details")),function(g,h){return g+h},0)},checkForUpdates:function(g){if(this.hdas.running().length){this.setUpdateTimeout()}else{this.trigger("ready");if(_.isFunction(g)){g.call(this)}}return this},setUpdateTimeout:function(g){g=g||e.UPDATE_DELAY;var h=this;this.clearUpdateTimeout();this.updateTimeoutId=setTimeout(function(){h.refresh()},g);return this.updateTimeoutId},clearUpdateTimeout:function(){if(this.updateTimeoutId){clearTimeout(this.updateTimeoutId);this.updateTimeoutId=null}},refresh:function(h,g){h=h||[];g=g||{};var i=this;g.data=g.data||{};if(h.length){g.data.details=h.join(",")}var j=this.hdas.fetch(g);j.done(function(k){i.checkForUpdates(function(){this.fetch()})});return j},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}});e.UPDATE_DELAY=4000;e.getHistoryData=function f(h,r){r=r||{};var l=r.hdaDetailIds||[];var n=jQuery.Deferred(),m=null;function i(s){return jQuery.ajax(galaxy_config.root+"api/histories/"+h)}function g(s){if(!s||!s.state_ids){return 0}return _.reduce(s.state_ids,function(t,v,u){return t+v.length},0)}function q(t){if(!g(t)){return[]}if(_.isFunction(l)){l=l(t)}var s=(l.length)?({details:l.join(",")}):({});return jQuery.ajax(galaxy_config.root+"api/histories/"+t.id+"/contents",{data:s})}var p=r.historyFn||i,o=r.hdaFn||q;var k=p(h);k.done(function(s){m=s;n.notify({status:"history data retrieved",historyJSON:m})});k.fail(function(u,s,t){n.reject(u,"loading the history")});var j=k.then(o);j.then(function(s){n.notify({status:"dataset data retrieved",historyJSON:m,hdaJSON:s});n.resolve(m,s)});j.fail(function(u,s,t){n.reject(u,"loading the datasets",{history:m})});return n};var d=Backbone.Collection.extend(a.LoggableMixin).extend({model:e,urlRoot:galaxy_config.root+"api/histories"});return{History:e,HistoryCollection:d}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/base-mvc","utils/localization"],function(c,a,b){var e=Backbone.Model.extend(a.LoggableMixin).extend({defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:false},urlRoot:galaxy_config.root+"api/histories",initialize:function(h,i,g){g=g||{};this.logger=g.logger||null;this.log(this+".initialize:",h,i,g);this.hdas=new c.HDACollection(i||[],{historyId:this.get("id")});if(i&&_.isArray(i)){this.hdas.reset(i)}this._setUpListeners();this.updateTimeoutId=null},_setUpListeners:function(){this.on("error",function(h,k,g,j,i){this.errorHandler(h,k,g,j,i)});if(this.hdas){this.listenTo(this.hdas,"error",function(){this.trigger.apply(this,["error:hdas"].concat(jQuery.makeArray(arguments)))})}this.on("change:id",function(h,g){if(this.hdas){this.hdas.historyId=g}},this)},errorHandler:function(h,k,g,j,i){this.clearUpdateTimeout()},ownedByCurrUser:function(){if(!Galaxy||!Galaxy.currUser){return false}if(Galaxy.currUser.isAnonymous()||Galaxy.currUser.id!==this.get("user_id")){return false}return true},hdaCount:function(){return _.reduce(_.values(this.get("state_details")),function(g,h){return g+h},0)},checkForUpdates:function(g){if(this.hdas.running().length){this.setUpdateTimeout()}else{this.trigger("ready");if(_.isFunction(g)){g.call(this)}}return this},setUpdateTimeout:function(g){g=g||e.UPDATE_DELAY;var h=this;this.clearUpdateTimeout();this.updateTimeoutId=setTimeout(function(){h.refresh()},g);return this.updateTimeoutId},clearUpdateTimeout:function(){if(this.updateTimeoutId){clearTimeout(this.updateTimeoutId);this.updateTimeoutId=null}},refresh:function(h,g){h=h||[];g=g||{};var i=this;g.data=g.data||{};if(h.length){g.data.details=h.join(",")}var j=this.hdas.fetch(g);j.done(function(k){i.checkForUpdates(function(){this.fetch()})});return j},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}});e.UPDATE_DELAY=4000;e.getHistoryData=function f(h,r){r=r||{};var l=r.hdaDetailIds||[];var n=jQuery.Deferred(),m=null;function i(s){return jQuery.ajax(galaxy_config.root+"api/histories/"+h)}function g(s){if(!s||!s.state_ids){return 0}return _.reduce(s.state_ids,function(t,v,u){return t+v.length},0)}function q(t){if(!g(t)){return[]}if(_.isFunction(l)){l=l(t)}var s=(l.length)?({details:l.join(",")}):({});return jQuery.ajax(galaxy_config.root+"api/histories/"+t.id+"/contents",{data:s})}var p=r.historyFn||i,o=r.hdaFn||q;var k=p(h);k.done(function(s){m=s;n.notify({status:"history data retrieved",historyJSON:m})});k.fail(function(u,s,t){n.reject(u,"loading the history")});var j=k.then(o);j.then(function(s){n.notify({status:"dataset data retrieved",historyJSON:m,hdaJSON:s});n.resolve(m,s)});j.fail(function(u,s,t){n.reject(u,"loading the datasets",{history:m})});return n};var d=Backbone.Collection.extend(a.LoggableMixin).extend({model:e,urlRoot:galaxy_config.root+"api/histories"});return{History:e,HistoryCollection:d}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: devteam: Fix for generating metadata when a tool dependency definition sets multiple environment variables within a single <set_environment> tool dependency type.
by commits-noreply@bitbucket.org 02 May '14
by commits-noreply@bitbucket.org 02 May '14
02 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3f8e48526231/
Changeset: 3f8e48526231
User: devteam
Date: 2014-05-02 18:50:57
Summary: Fix for generating metadata when a tool dependency definition sets multiple environment variables within a single <set_environment> tool dependency type.
Affected #: 1 file
diff -r 888cd02028b37f93beba8b175fec8c85a912ac9f -r 3f8e4852623187152ffaea5fd529fac2001c8316 lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -563,14 +563,11 @@
# <set_environment version="1.0">
# <environment_variable name="JAVA_JAR_PATH" action="set_to">$INSTALL_DIR</environment_variable>
# </set_environment>
- requirements_dict = {}
for env_elem in elem:
# <environment_variable name="JAVA_JAR_PATH" action="set_to">$INSTALL_DIR</environment_variable>
env_name = env_elem.get( 'name', None )
if env_name:
- requirements_dict[ 'name' ] = env_name
- requirements_dict[ 'type' ] = 'set_environment'
- if requirements_dict:
+ requirements_dict = dict( name=env_name, type='set_environment' )
if 'set_environment' in valid_tool_dependencies_dict:
valid_tool_dependencies_dict[ 'set_environment' ].append( requirements_dict )
else:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0