Commit 961f6a1c authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

js/scatterPlot.js: fixes function calls for bar plots

Completes 0333bf01 and fixes #2091.
parent 2ce95b4d
...@@ -691,16 +691,16 @@ ScatterPlot.prototype = { ...@@ -691,16 +691,16 @@ ScatterPlot.prototype = {
//split clones into bar (axisX) //split clones into bar (axisX)
switch (this.splitX) { switch (this.splitX) {
case "allele_v" : case "allele_v" :
this.makeBarTab(function(cloneID){return self.m.clone(cloneID).getGene("5")}, Object.keys(self.m.germlineV.allele)) this.makeBarTab(function(clone){return clone.getGene("5")}, Object.keys(self.m.germlineV.allele))
break; break;
case "gene_v" : case "gene_v" :
this.makeBarTab(function(cloneID){return self.m.clone(cloneID).getGene("5",false)}, Object.keys(self.m.germlineV.gene)) this.makeBarTab(function(clone){return clone.getGene("5",false)}, Object.keys(self.m.germlineV.gene))
break; break;
case "allele_j" : case "allele_j" :
this.makeBarTab(function(cloneID){return self.m.clone(cloneID).getGene("3")}, Object.keys(self.m.germlineJ.allele)) this.makeBarTab(function(clone){return clone.getGene("3")}, Object.keys(self.m.germlineJ.allele))
break; break;
case "gene_j" : case "gene_j" :
this.makeBarTab(function(cloneID){return self.m.clone(cloneID).getGene("3",false)}, Object.keys(self.m.germlineJ.gene)) this.makeBarTab(function(clone){return clone.getGene("3",false)}, Object.keys(self.m.germlineJ.gene))
break; break;
default : default :
if (typeof this.available_axis[this.splitX]) if (typeof this.available_axis[this.splitX])
...@@ -712,22 +712,22 @@ ScatterPlot.prototype = { ...@@ -712,22 +712,22 @@ ScatterPlot.prototype = {
switch (this.splitY) { switch (this.splitY) {
case "allele_v" : case "allele_v" :
this.sortBarTab(function(cloneID){return self.m.clone(cloneID).getGene("5")}); this.sortBarTab(function(clone){return clone.getGene("5")});
break; break;
case "gene_v" : case "gene_v" :
this.sortBarTab(function(cloneID){return self.m.clone(cloneID).getGene("5",false)}); this.sortBarTab(function(clone){return clone.getGene("5",false)});
break; break;
case "allele_j" : case "allele_j" :
this.sortBarTab(function(cloneID){return self.m.clone(cloneID).getGene("3")}); this.sortBarTab(function(clone){return clone.getGene("3")});
break; break;
case "gene_j" : case "gene_j" :
this.sortBarTab(function(cloneID){return self.m.clone(cloneID).getGene("3",false)}); this.sortBarTab(function(clone){return clone.getGene("3",false)});
break; break;
default : default :
if (typeof this.available_axis[this.splitY]){ if (typeof this.available_axis[this.splitY]){
this.sortBarTab(this.available_axis[this.splitY].fct); this.sortBarTab(this.available_axis[this.splitY].fct);
}else{ }else{
this.sortBarTab(function(a){return self.m.clone(a).getGene("3")}); this.sortBarTab(function(clone){return clone.getGene("3")});
} }
break; break;
} }
...@@ -823,12 +823,12 @@ ScatterPlot.prototype = { ...@@ -823,12 +823,12 @@ ScatterPlot.prototype = {
this.barTab[i].sort(function (a,b) { this.barTab[i].sort(function (a,b) {
var va; var va;
try{ try{
var va = fct(a); var va = fct(this.m.clone(a));
}catch(e){ }catch(e){
} }
var vb; var vb;
try{ try{
var vb = fct(b); var vb = fct(this.m.clone(b));
}catch(e){} }catch(e){}
if (typeof va == "undefined") return (typeof vb == "undefined") ? 0 : -1; if (typeof va == "undefined") return (typeof vb == "undefined") ? 0 : -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment