mirror of https://github.com/geohot/qira
graph is persistant
This commit is contained in:
parent
4712ccf335
commit
128c4514fb
|
@ -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;
|
||||
|
|
|
@ -54,3 +54,4 @@
|
|||
<div class="col" id="staticpanel"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Reference in New Issue