graph is persistant

This commit is contained in:
George Hotz 2014-09-14 22:16:23 +00:00
parent 4712ccf335
commit 128c4514fb
2 changed files with 15 additions and 0 deletions

View File

@ -87,16 +87,30 @@ Graph.prototype.inLineage = function(addr, qaddr, seen) {
return false;
};
var gPos = {};
// this runs sugiyama...
Graph.prototype.render = function() {
var name = Object.keys(this.vertices).toString();
var send = "digraph graphname {\n";
// record the old gbox position
var oldgbox = $("#gbox");
if (oldgbox.length > 0) {
gPos[oldgbox[0].className] = [fdec(oldgbox.css("margin-left")), fdec(oldgbox.css("margin-top"))];
}
var outergbox = $('<div id="outergbox"></div>');
$("#staticpanel").html("");
gbox = document.createElement('div');
outergbox[0].appendChild(gbox);
document.getElementById("staticpanel").appendChild(outergbox[0]);
gbox.id = 'gbox';
gbox.className = name;
if (name in gPos) {
$("#gbox").css("margin-left", gPos[name][0]);
$("#gbox").css("margin-top", gPos[name][1]);
}
for (addr in this.vertices) {
var r = this.vertices[addr].rendered;

View File

@ -54,3 +54,4 @@
<div class="col" id="staticpanel"></div>
</body>
</html>