Commit 2cfc7cb8 authored by Marc Duez's avatar Marc Duez

export.js : improve diag report

parent 70efc574
......@@ -18,6 +18,8 @@ Report.prototype = {
.addGraph(list)
.readsStat()
.cloneList(list)
m.resize()
}
},
......@@ -36,7 +38,9 @@ Report.prototype = {
var system = m.system_selected[i]
self.addScatterplot(system, m.t)
}
self.cloneList(list)
self.cloneList(list, m.t)
m.resize()
}
},
......@@ -331,47 +335,55 @@ Report.prototype = {
return pie
},
cloneList : function(list) {
cloneList : function(list, time) {
if (typeof time == "undefined") time = -1
var container = this.container('Selected clones')
for (var i=0; i<list.length; i++){
var cloneID = list[i]
this.clone(cloneID).appendTo(container)
this.clone(cloneID, time).appendTo(container)
}
return this
},
clone : function(cloneID) {
clone : function(cloneID, time) {
if (typeof time == "undefined") time = -1
var color = tagColor[m.clone(cloneID).getTag()]
var clone = $('<div/>', {class: 'clone'})
graph.resize(791,300)
graph.draw(0)
var icon = $('<span/>', {class: 'icon'}).appendTo(clone);
var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
var polyline = document.getElementById("polyline" + cloneID).cloneNode(true)
var color = tagColor[m.clone(cloneID).getTag()]
polyline.setAttribute("stroke", color);
polyline.setAttribute("style", "stroke-width:30px");
svg.appendChild(polyline)
svg.setAttribute("viewBox","0 0 791 300");
svg.setAttribute("width","80px");
svg.setAttribute("height","30px");
icon.append(svg)
$('<span/>', {text: m.clone(cloneID).name}).appendTo(clone);
var head = $('<div/>', {class: 'clone_head'}).appendTo(clone);
if (time == -1){
var icon = $('<span/>', {class: 'icon'}).appendTo(head);
var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
var polyline = document.getElementById("polyline" + cloneID).cloneNode(true)
polyline.setAttribute("stroke", color);
polyline.setAttribute("style", "stroke-width:30px");
svg.appendChild(polyline)
svg.setAttribute("viewBox","0 0 791 300");
svg.setAttribute("width","80px");
svg.setAttribute("height","30px");
icon.append(svg)
}
$('<span/>', {text: m.clone(cloneID).name, class: 'clone_name', style : 'color:'+color}).appendTo(head);
if (typeof m.clone(cloneID).c_name != "undefined"){
$('<span/>', {text: m.clone(cloneID).c_name}).appendTo(clone);
$('<span/>', {text: m.clone(cloneID).c_name, class: 'clone_name', style : 'color:'+color}).appendTo(head);
}
var reads_stats = $('<div/>', {class: 'clone_table'}).appendTo(clone);
for (var i=0; i<m.samples.order.length; i++){
var time = m.samples.order[i]
$('<div/>', {text : m.clone(cloneID).getStrSize(time), class: 'clone_value'}).appendTo(reads_stats);
if (time == -1){
var reads_stats = $('<div/>', {class: 'clone_table'}).appendTo(clone);
for (var i=0; i<m.samples.order.length; i++){
var t = m.samples.order[i]
$('<div/>', {text : m.clone(cloneID).getStrSize(t), class: 'clone_value'}).appendTo(reads_stats);
}
}else{
$('<span/>', {text : m.clone(cloneID).getStrSize(time), class: 'float-right'}).appendTo(head);
}
var sequence = $('<div/>', {class: 'sequence'}).appendTo(clone);
......
......@@ -243,14 +243,28 @@
.circle{
stroke : none;
}
.float-right{
float: right;
}
.clone{
font-size : 75%;
margin: 1em 0;
}
.clone_head{
border-bottom: solid;
border-width: 1px;
}
.clone_name{
border-right:solid;
border-width:1px;
margin-right:20px;
padding-right:20px;
font-weight: bold;
}
.clone_table{
margin: 0 auto 0 auto;
float: left;
text-align: center;
border-top: solid;
border-bottom: solid;
border-width: 1px;
display: flex;
......
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