Commit 3c2fface authored by Marc Duez's avatar Marc Duez

export.js : html export [WIP]

parent 8d80b277
......@@ -68,6 +68,7 @@
<script type="text/javascript" src='js/conf.js'></script>
<script type="text/javascript" src='js/stats.js'></script>
<script type="text/javascript" src='js/shortcut.js'></script>
<script type="text/javascript" src='js/export.js'></script>
</head>
......@@ -143,6 +144,7 @@
<a class="buttonSelector" onclick="javascript:pdf.make()">export pdf (graph + selected clones)</a>
<a class="buttonSelector" onclick="javascript:pdf.makeGraph()">export pdf (graph)</a>
<a class="buttonSelector" onclick="javascript:m.exportCSV()">export csv (visible clones)</a>
<a class="buttonSelector" onclick="javascript:startReport()">test</a>
</div>
<div class="menu_box">
<div id="upload_list">
......
function startReport() {
var w = window.open("report.html", "_blank", "selected=no");
w.onload = function(){
$('<hr/>').appendTo(w.document.body);
//resize 791px ~> 21cm
graph.resize(791,300)
//add graph container now
var w_graph = $('<div/>', {
id: 'graph',
class: 'container'
}).appendTo(w.document.body);
//but complete it asynchronously
setTimeout(function(){
svg_graph = document.getElementById(graph.id).cloneNode(true);
for (var i = 0; i < this.m.clones.length; i++) {
var polyline = svg_graph.querySelectorAll('[id="polyline'+i+'"]')[0]
var color = tagColor[this.m.clone(i).getTag()]
//stack
if (polyline.getAttribute("d").indexOf("Z") != -1){
polyline.setAttribute("style", "stroke-width:0px");
polyline.setAttribute("fill", color);
}else{//line
polyline.setAttribute("style", "stroke-width:1px");
polyline.setAttribute("stroke", color);
}
//remove "other" and disabled clones
if (m.clone(i).id == "other" || !m.clone(i).isActive()) {
polyline.parentNode.removeChild(polyline);
}
}
w_graph.html(svg_graph.innerHTML)
graph.resize();
},500)
}
}
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