Skip to content

Commit

Permalink
Compute edge doi/visibility only after all nodes are done
Browse files Browse the repository at this point in the history
(commit robert-hoff@0e11399)

prefuse#33 reported that some edges were missing, if distance == 0. The missing
edges were edges to parents, which were already connected to other focus
nodes.
  • Loading branch information
magsilva committed Dec 31, 2020
1 parent 45cea56 commit 2d02943
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/prefuse/action/filter/FisheyeTreeFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,13 @@ public void run(double frac) {
VisualItem item = (VisualItem)items.next();
if ( item.getDOI() == Constants.MINIMUM_DOI )
PrefuseLib.updateVisible(item, false);
}
else {
EdgeItem e =(EdgeItem) ((NodeItem)item).getParentEdge();
if (e != null) {
e.setDOI(item.getDOI());
PrefuseLib.updateVisible(e, true);
}
}
}

/**
Expand All @@ -175,12 +181,6 @@ private void visit(NodeItem n, NodeItem c, int doi, int ldist) {
PrefuseLib.updateVisible(n, true);
double localDOI = -ldist / Math.min(1000.0, m_divisor);
n.setDOI(doi+localDOI);

if ( c != null ) {
EdgeItem e = (EdgeItem)c.getParentEdge();
e.setDOI(c.getDOI());
PrefuseLib.updateVisible(e, true);
}
}

/**
Expand Down

0 comments on commit 2d02943

Please sign in to comment.