Commit d7fce16e authored by flothoni's avatar flothoni

model.js; add new function getCurrentSystem

Allow to know current system in use
Link to #4014
parent 9c0a5850
Pipeline #199230 passed with stages
in 20 minutes and 20 seconds
......@@ -2010,7 +2010,7 @@ Clone.prototype = {
// if scatterplot is in "one_system" mode
if (this.m.system != "multi" || typeof this.m.system != 'undefined'){
var locus = this.getLocus()
var same_locus = (this.m.current_system == locus)
var same_locus = (this.m.getCurrentSystem() == locus)
return (x.equals(axes) && same_locus)
} else {
return x.equals(axes)
......
......@@ -66,7 +66,6 @@ function Model() {
this.NORM_EXTERNAL = "external"
this.normalization_mode = this.NORM_FALSE
this.available_axes = Axis.prototype.available()
this.current_system = undefined
setInterval(function(){return self.updateIcon()}, 100);
}
......@@ -325,7 +324,6 @@ Model.prototype = {
}
}
}
this.current_system = system
return this.germlineV.load(system, "V", this)
.germlineD.load(system, "D", this)
......@@ -333,6 +331,9 @@ Model.prototype = {
}, //end loadGermline
getCurrentSystem: function(){
return this.germlineV.system
},
/**
* compute some meta-data for each clones
* */
......
......@@ -299,7 +299,7 @@ ScatterPlot.prototype = {
},
includeBar: function(clone, log) {
var system_grid = (!this.use_system_grid || (this.use_system_grid && this.m.germlineV.system == clone.get('germline') ))
var system_grid = (!this.use_system_grid || (this.use_system_grid && this.m.getCurrentSystem() == clone.get('germline') ))
var showVirtual;
// Set if the clone should be show on is virtual/distrib status
......@@ -519,7 +519,7 @@ ScatterPlot.prototype = {
var xpos = 0.8
if (system != this.m.germlineV.system) {
if (system != this.m.getCurrentSystem()) {
this.systemGrid.label.push({
"text": system,
"enabled": enabled,
......@@ -834,8 +834,8 @@ ScatterPlot.prototype = {
this.updateElemStyle();
if (this.m.germlineV.system != this.system) {
this.system = this.m.germlineV.system
if (this.m.getCurrentSystem() != this.system) {
this.system = this.m.getCurrentSystem() //
this.changeSplitMethod(this.splitX, this.splitY, this.mode)
}
return this;
......@@ -958,7 +958,7 @@ ScatterPlot.prototype = {
if (xpos === undefined) node.hasValidAxisPosition = false
if (ypos === undefined) node.hasValidAxisPosition = false
if (this.use_system_grid && this.m.system == "multi" && typeof sys != 'undefined' && sys != this.m.germlineV.system) {
if (this.use_system_grid && this.m.system == "multi" && typeof sys != 'undefined' && sys != this.m.getCurrentSystem()) {
node.use_system_grid = true
node.x2 = Math.random()*0.01 + this.systemGrid[sys].x * this.resizeW;
node.y2 = Math.random()*0.01 + this.systemGrid[sys].y * this.resizeH;
......
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