Commit 35891b94 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

Merge branch 'feature-c/tweak_colorBy' into 'dev'

Feature c/tweak color by

Closes #1976

See merge request !875
parents db46b58a 856e52bf
Pipeline #226384 failed with stages
in 10 minutes and 14 seconds
......@@ -160,7 +160,7 @@
</div>
<div class="menu" id="color_menu" onmouseover="showSelector('colorSelector');" > color by
<div class="div-menu-selector"><select id="color_menu_select" class="menu-selector" onchange="m.changeColorMethod(this.value)">
<div class="div-menu-selector"><select id="color_menu_select" class="menu-selector" onchange="m.changeColorMethod(this.value, true, true)">
<option value="Tag">tag</option>
<option value="clone">clone</option>
<option value="cdr3">CDR3</option>
......
function Report(model) {
this.m = model
this.m = model;
this.colorMode = "colorBy"; // "colorBy" / "tag" / TODO...
}
Report.prototype = {
......@@ -432,7 +433,7 @@ Report.prototype = {
for (var i = 0; i < this.m.clones.length; i++) {
var polyline = svg_graph.querySelectorAll('[id="polyline'+i+'"]')[0]
var tag = this.m.clone(i).getTag()
var color = this.m.tag[tag].color
var color = this.getCloneExportColor(i);
if (typeof polyline == 'undefined')
continue;
......@@ -522,7 +523,7 @@ Report.prototype = {
for (var i = 0; i < this.m.clones.length; i++) {
var circle = svg_sp.querySelectorAll('[id="'+this.m.sp.id+'_circle'+i+'"]')[0]
var color = this.m.tag[this.m.clone(i).getTag()].color
var color = this.getCloneExportColor(i);
circle.setAttribute("stroke", color);
//remove virtual and disabled clones
......@@ -685,7 +686,7 @@ Report.prototype = {
clone : function(cloneID, time) {
if (typeof time == "undefined") time = -1
var color = this.m.tag[this.m.clone(cloneID).getTag()].color
var color = this.getCloneExportColor(cloneID);
var system = this.m.clone(cloneID).germline
var clone = $('<div/>', {'class': 'clone'})
......@@ -816,6 +817,22 @@ Report.prototype = {
"\n\n" + clones)
;
window.location.href = link;
},
getCloneExportColor : function(cloneID){
var color;
switch (this.colorMode) {
case "tag":
rcolor = this.m.tag[this.m.clone(cloneID).getTag()].color;
break;
case "colorBy":
color = this.m.clone(cloneID).getColor();
break;
default:
color = this.m.clone(cloneID).getColor();
break;
}
return color;
}
}
......
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