implemented clear canvas too... sort of
This commit is contained in:
parent
35dd8c1816
commit
e762be0be3
1 changed files with 25 additions and 5 deletions
|
@ -163,14 +163,34 @@ function onCanvasSearch(name,mapID,mapperID) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function clearCanvas() {
|
function clearCanvas() {
|
||||||
Mconsole.graph.eachNode( function(n) { Mconsole.graph.removeNode(n.id); Mconsole.labels.disposeLabel(n.id); });
|
Mconsole.graph.eachNode(function(n) {
|
||||||
Mconsole.plot();
|
Mconsole.graph.removeNode(n.id);
|
||||||
|
Mconsole.labels.disposeLabel(n.id);
|
||||||
|
});
|
||||||
|
Mconsole.plot();
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearCanvasExceptRoot() {
|
||||||
|
var ids = new Array();
|
||||||
|
Mconsole.graph.eachNode(function(n) {
|
||||||
|
ids.push(n.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
var root = Mconsole.graph.nodes[Mconsole.root];
|
||||||
|
ids.forEach(function(id, index) {
|
||||||
|
if (id != root.id) {
|
||||||
|
Mconsole.graph.removeNode(id);
|
||||||
|
//OK I feel bad about this, but not too bad
|
||||||
|
//TODO: this leaves labels hidden on the map
|
||||||
|
Mconsole.labels.hideLabel(id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fetchRelatives(root); //also runs Mconsole.plot()
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearFoundData() {
|
function clearFoundData() {
|
||||||
Mconsole.graph.eachNode( function(n) {
|
Mconsole.graph.eachNode( function(n) {
|
||||||
if (n.getData('inCommons') === true) {
|
if (n.getData('inCommons') === true) {
|
||||||
Mconsole.graph.removeNode(n.id);
|
Mconsole.graph.removeNode(n.id);
|
||||||
Mconsole.labels.disposeLabel(n.id);
|
Mconsole.labels.disposeLabel(n.id);
|
||||||
|
|
Loading…
Reference in a new issue