Commit 461aeaf9 authored by Marc Duez's avatar Marc Duez
Browse files

scatterplot.js : show unselected system in scatterplot system_label

parent a0399da7
...@@ -1507,10 +1507,15 @@ Model.prototype = { ...@@ -1507,10 +1507,15 @@ Model.prototype = {
* *
* */ * */
changeGermline: function (system) { changeGermline: function (system) {
if (this.system_selected.indexOf(system) == -1){
this.system_selected.push(system)
}
this.loadGermline(system) this.loadGermline(system)
.resize() .resize()
.update() .update()
var radio = document.getElementsByName("germline") var radio = document.getElementsByName("germline")
for(var elem in radio){ for(var elem in radio){
if (radio[elem].value == system) radio[elem].checked=true; if (radio[elem].value == system) radio[elem].checked=true;
......
...@@ -816,7 +816,7 @@ ScatterPlot.prototype = { ...@@ -816,7 +816,7 @@ ScatterPlot.prototype = {
buildSystemGrid: function () { buildSystemGrid: function () {
this.systemGrid = {"label" : []} this.systemGrid = {"label" : []}
var n = this.m.system_selected.length var n = this.m.system_available.length
var h = this.resizeH var h = this.resizeH
var w = this.resizeW*0.2 var w = this.resizeW*0.2
...@@ -828,12 +828,17 @@ ScatterPlot.prototype = { ...@@ -828,12 +828,17 @@ ScatterPlot.prototype = {
//compute position for selected germline //compute position for selected germline
var i=0; var i=0;
for (var key in this.m.system_selected){ for (var key in this.m.system_available){
var system = this.m.system_selected[key]
var system = this.m.system_available[key]
var enabled = false
if (this.m.system_selected.indexOf(system) != -1 ) enabled = true
if (system != this.m.germlineV.system){ if (system != this.m.germlineV.system){
this.systemGrid["label"].push( {"text": system, "x" : 0.81, "y" : ((i*2)+1)/(n*2) }) this.systemGrid["label"].push( {"text": system, "enabled": enabled, "x" : 0.81, "y" : ((i*2)+1)/(n*2) })
}else{ }else{
this.systemGrid["label"].push( {"text": system, "x" : 0.80, "y" : ((i*2)+1)/(n*2) }) this.systemGrid["label"].push( {"text": system, "enabled": enabled, "x" : 0.80, "y" : ((i*2)+1)/(n*2) })
} }
this.systemGrid[system].x = 0.92 this.systemGrid[system].x = 0.92
this.systemGrid[system].y = ((i*2)+1)/(n*2) this.systemGrid[system].y = ((i*2)+1)/(n*2)
...@@ -1496,7 +1501,7 @@ ScatterPlot.prototype = { ...@@ -1496,7 +1501,7 @@ ScatterPlot.prototype = {
system_label_update: function(data) { system_label_update: function(data) {
self = this; self = this;
if (typeof data == "undefined" || data.length <=1){ if (typeof data == "undefined" || self.m.system_selected.length <=1){
this.label_container.style("display", "none"); this.label_container.style("display", "none");
}else{ }else{
this.label_container.style("display", ""); this.label_container.style("display", "");
...@@ -1520,7 +1525,10 @@ ScatterPlot.prototype = { ...@@ -1520,7 +1525,10 @@ ScatterPlot.prototype = {
.on("click", function (d) { .on("click", function (d) {
self.m.changeGermline(d.text) self.m.changeGermline(d.text)
}) })
.attr("class", "sp_system_label") .attr("class", function (d) {
if (d.enabled) return "sp_system_label"
return "sp_system_label inactive"
})
} }
}, },
......
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