Commit 5b15c5d3 authored by Marc Duez's avatar Marc Duez

export.js : info() / sampleInfo()

parent 3207ac9c
......@@ -13,7 +13,8 @@ Report.prototype = {
if (list.length==0) list = this.defaultList()
this.w.onload = function(){
self.normalizeInfo(list)
self.info()
.normalizeInfo(list)
.addGraph(list)
.readsStat()
.addScatterplot()
......@@ -29,6 +30,8 @@ Report.prototype = {
if (list.length==0) list = this.defaultList()
this.w.onload = function(){
self.info()
.sampleInfo(m.t)
for (var i=0; i<m.system_selected.length; i++){
var system = m.system_selected[i]
self.addScatterplot(system, m.t)
......@@ -63,6 +66,60 @@ Report.prototype = {
return container
},
info : function() {
var info = this.container("Report info")
var left = $('<div/>', {class: 'flex'}).appendTo(info);
var date = new Date;
var timestamp = date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate()
var label = $('<div/>', {class: 'float-left'}).appendTo(left);
$('<div/>', {class: 'case label', text : "Filename:" }).appendTo(label);
$('<div/>', {class: 'case label', text : "Report date:" }).appendTo(label);
$('<div/>', {class: 'case label', text : "Soft version:" }).appendTo(label);
$('<div/>', {class: 'case label', text : "Run date:" }).appendTo(label);
var value = $('<div/>', {class: 'float-left'}).appendTo(left);
$('<div/>', {class: 'case', text : m.dataFileName }).appendTo(value);
$('<div/>', {class: 'case', text : timestamp}).appendTo(value);
$('<div/>', {class: 'case', text : "vidjil version" }).appendTo(value);
$('<div/>', {class: 'case', text : m.timestamp[0].split(" ")[0] }).appendTo(value);
var note = $('<div/>', {class: 'float-left'}).appendTo(left);
$('<div/>', {class: 'case label', text : "User note" }).appendTo(note);
$('<div/>', {class: 'note', text : m.info }).appendTo(note);
return this
},
sampleInfo : function(time) {
var sinfo = this.container("Sample info ("+m.getStrTime(time)+")")
var left = $('<div/>', {class: 'flex'}).appendTo(sinfo);
var label = $('<div/>', {class: 'float-left'}).appendTo(left);
$('<div/>', {class: 'case label', text : "Filename:" }).appendTo(label);
$('<div/>', {class: 'case label', text : "Sample date:" }).appendTo(label);
$('<div/>', {class: 'case label', text : "Soft version:" }).appendTo(label);
$('<div/>', {class: 'case label', text : "Command:" }).appendTo(label);
$('<div/>', {class: 'case label', text : "Run date:" }).appendTo(label);
var value = $('<div/>', {class: 'float-left'}).appendTo(left);
$('<div/>', {class: 'case', text : m.samples.original_names[time]}).appendTo(value);
$('<div/>', {class: 'case', text : m.samples.timestamp[time]}).appendTo(value);
$('<div/>', {class: 'case', text : ""}).appendTo(value);
$('<div/>', {class: 'case', text : ""}).appendTo(value);
$('<div/>', {class: 'case', text : ""}).appendTo(value);
var note = $('<div/>', {class: 'float-left'}).appendTo(left);
$('<div/>', {class: 'case label', text : "User note" }).appendTo(note);
$('<div/>', {class: 'note', text : m.samples.info[time] }).appendTo(note);
return this
},
svg_graph : function(list, norm) {
if (typeof norm == "undefined") norm = -1
var svg_graph = document.getElementById(graph.id+"_svg").cloneNode(true);
......
......@@ -99,7 +99,7 @@
font-family: monospace;
background: #CCC;
}
.reads_stats{
.flex{
width: 100%;
display: flex;
font-size: 80%;
......@@ -112,6 +112,7 @@
.float-left {
margin: 0 auto 0 0;
float: left;
min-width: 120px;
}
.left {
float: left;
......@@ -141,6 +142,17 @@
float: left;
margin-right: 0.5em;
}
.note{
background-color : grey;
min-height: 5em;
width: 450px;
background-color: #EEE;
padding: 5px;
font-family:courier;
}
.label{
opacity:0.8;
}
</style>
<!-- graph style-->
......@@ -232,14 +244,6 @@
<div id="header-title">Vidjil html report v0.1</div>
</div>
<div id="info" class="container">
<h3>Report info</h3>
<div id="info-file"> <span class="label">name:</span> <span class="value">james</span> </div>
<div id="patient-birth"> <span class="label">birth date:</span> <span class="value">unknow</span> </div>
<div id="patient-id"> <span class="label">ID:</span> <span class="value">007</span> </div>
</div>
</body>
</html>
\ No newline at end of file
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