Permalink
Browse files

Indicate docs containing mutual references with arrow-free edges.

  • Loading branch information...
1 parent 892b623 commit fe7b29b225755289dfc6775fb08d30d00562a84a @paulcarey committed Jan 13, 2009
Showing with 15 additions and 16 deletions.
  1. +2 −2 README.textile
  2. BIN bin/Fuschia.swf
  3. +13 −14 src/Fuschia.as
View
@@ -44,9 +44,9 @@ The "flare tutorial":http://flare.prefuse.org/tutorial is the best place to get
Instructions on developing with "flare in textmate":http://arrifana.org/blog/2008/03/flare-flex-sdk-and-mac-osx/.
-h3. Known Issues
+h3. Quirks
- * Edges don't display bi-directional arrows
+ * prefuse doesn't support edges with bi-directional arrows, so documents containing mutual references are represented by arrow-free edges.
h3. Example
View
Binary file not shown.
View
@@ -272,14 +272,14 @@ package {
private function displayInDocs(result:Object):void
{
for each (var r:Object in result.rows) {
- var es:EdgeSprite = getEdgeSprite(r.id, r.key);
+ getEdgeSprite(r.id, r.key);
}
}
private function displayOutDocs(result:Object):void
{
for each (var r:Object in result.rows) {
- var es:EdgeSprite = getEdgeSprite(r.key, r.value);
+ getEdgeSprite(r.key, r.value);
}
}
@@ -336,26 +336,25 @@ package {
trace("getEdge: " + edgeId);
var es:EdgeSprite = edgeMap[edgeId];
- if (es == null) {
+ var otherEs:EdgeSprite = edgeMap[otherEdgeId];
+
+ if (otherEs != null) {
+ // We can't show bidirectional arrows so display
+ // bidirectional relations by removing the arrow
+ otherEs.arrowType = ArrowType.NONE;
+ return otherEs;
+ } else if (es == null) {
trace("adding edge: " + edgeId);
var source:NodeSprite = getNodeSprite(source_id);
var target:NodeSprite = getNodeSprite(target_id);
es = data.addEdgeFor(source, target, true);
es.arrowType = ArrowType.TRIANGLE;
es.arrowWidth = 15;
edgeMap[edgeId] = es;
+ return es;
+ } else {
+ return es;
}
-
- // Remove the other edge as a workaround for apparently ineffectual
- // sort orders - defining a z-index and sorting on it only has the
- // desired effect on the first draw
- var otherEs:EdgeSprite = edgeMap[otherEdgeId];
- if (otherEs != null) {
- trace("removing edge: " + otherEdgeId);
- data.removeEdge(otherEs);
- delete edgeMap[otherEdgeId];
- }
- return es;
}
}

0 comments on commit fe7b29b

Please sign in to comment.