This graph view demo applies the prefuse GraphDistanceFilter to the following two groups:
- Hover Group: This group contains the node under the mouse cursor if any.
- Search Result Group: The result of a search query
The complete graph is displayed if both groups are empty.
In addition, a modification of the ForceDirectedLayout is used, which allows invisible nodes/edges to become magic and by that be taken into account for the calculation of the layout even so they are invisible.
Applying the graph distance filter to the search result group has the quite interesting effect of displaying the search result in it's neighborhood context exclusively. (if distance 1 is chosen)
The application of the distance filter on the node the mouse points to might be on the other hand more confusing than enlightening.
Thanks for the example.
I got errors when I open another file through the menu. Here are part of the errors:
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException
at prefuse.data.search.SearchTupleSet.removeTuple(SearchTupleSet.java:106)
at prefuse.Visualization.removeGroup(Visualization.java:703)
at prefuse.demos.GraphViewDistanceFilterVariationsInDMinorMagic.setGraph(GraphViewDistanceFilterVariationsInDMinorMagic.java:334)
at prefuse.demos.GraphViewDistanceFilterVariationsInDMinorMagic$OpenGraphAction.actionPerformed(GraphViewDistanceFilterVariationsInDMinorMagic.java:470)
I think the problem is that the old graph is removed by
Visualization::removeGroup()
But the SearchTupleSet cannot be removed, because its removeTuple is not implemented.
Do you have any solution? Thanks
Hi Shen,
hope you are happy.
This demo wasn't intended for changing the graphs, I should have removed the possibility from the demo but was just to lazy.
I have no laptop with me right now, so sorry I can't help you any further rather than encouraging you to find a solution yourself or via a post in the
sourceforge prefuse forum And if you find a solution, it would of course be great if you can post it here, either as a new version of this program or an own demo showing how to set up the search facility when the graph is changed.
Have fun
martin
Guest Wrote:Hi Shen,
hope you are happy.
This demo wasn't intended for changing the graphs, I should have removed the possibility from the demo but was just to lazy.
I have no laptop with me right now, so sorry I can't help you any further rather than encouraging you to find a solution yourself or via a post in the sourceforge prefuse forum And if you find a solution, it would of course be great if you can post it here, either as a new version of this program or an own demo showing how to set up the search facility when the graph is changed.
Have fun
martin
Hello all,
I solved the problem opening/loading a new file when searching is enabled. I added the changes to the code and am including it as a new version of this program.
Changes = anonymously overwriting the removeTuple method to implement the interface method:
SearchTupleSet search = new PrefixSearchTupleSet() {
public boolean removeTuple(Tuple t) {
clear();
return true;
}
};
Then I discovered the search panel became useless after loading the new graph. So I made the search panel, it's Box, and the force panel to be accessible fields so they can be updated and redrawn. See file for the actual implementation.
Hope this helps,
L[
attachment=133]
Hello Morganalori,
thanks a lot for sharing your insights here in this forum.
All the best
martin