frequently asked questions
- General Questions
- Technical Questions
- Support and Contribution
- What is prefuse? What can I do with it?
Prefuse is an extensible software framework for helping software developers create interactive information visualization applications using the Java programming language. It can be used to build standalone applications, visual components embedded in larger applications, and web applets. Prefuse intends to greatly simplify the processes of representing and efficiently handing data, mapping data to visual representations (e.g., through spatial position, size, shape, color, etc), and interacting with the data. Some of the features of prefuse include:
- Table, Graph, and Tree data structures supporting arbitrary data attributes, data indexing, and selection queries, all with an efficient memory footprint.
- Components for layout, color, size, and shape encodings, distortion techniques, animation, and more.
- A library of interaction controls for common interactive, direct-manipulation operations.
- Animation support through a general activity scheduling mechanism.
- View transformations supporting panning and zooming, including both geometric and semantic zooming.
- Dynamic queries for interactive filtering of data.
- Integrated text search using a number of available search engines.
- A physical force simulation engine for dynamic layout and animation.
- Flexibility for multiple views, including "overview+detail" and "small multiples" displays.
- A built in, SQL-like expression language for writing queries to prefuse data structures and creating derived data fields.
- Support for issuing queries to SQL databases and mapping query results into prefuse data structures.
- Simple, developer-friendly APIs for creating custom processing, interaction, and rendering components.
(and perhaps most importantly)
Prefuse has been used in school course projects, academic and industrial research, and commercial software development.
- What are the licensing terms?
Prefuse is released under the terms of a BSD (Berkeley Standard Distribution) license, making it free to use for both commercial and non-commercial purposes. The exact license terms are spelled out in the prefuse license.
- What background knowledge is expected?
Basic familiarity with the Java programming language, including setting up and building Java projects. A knowledge of Swing or another similar user interface toolkit is also of great help for understanding some of the concepts behind prefuse and for integrating prefuse visualizations into larger applications. Experience with database systems is also helpful (especially if using the built-in prefuse expression language for data manipulation), but is not required (and you might even learn a bit about it by using prefuse!).
If you are new to Java but still interested in exploring prefuse, one of the many Java books in print or tutorials available on the web will be of help. The use of an integrated development environment such as Eclipse, which greatly facilitates the process of both organizing and writing Java programs can save you a lot of headaches.
If you are interested in writing new Renderer components to control the appearance of items on the screen, a little background on 2D computer graphics will be of great help. The folks at the University of Maryland, College Park (creators of the excellent Piccolo toolkit) have put together a 2D graphics tutorial that you may find useful.
- How should I go about learning the toolkit?
Reading this FAQ is a good start, but the user's manual is really the place to begin learning in earnest. API documentation for all classes and methods in the toolkit is also available. Perhaps the most useful, however, is to investigate and interact with the various demonstration applications included with the toolkit. They are located in the "demos" folder of the toolkit distribution. Feel free to copy these demos and play with various modifications to get a feel of the space of possibilities. Finally, the prefuse toolkit is open-source so you can always look into the toolkit source code itself. When you really want to know how a particular module works, this is a good way to find out (and perhaps even good for you, too).
- What alternative toolkits might I also
If prefuse doesn't seem right for your application needs, there are a number of other toolkits with their own strengths of weaknesses, many of them designed to address different application needs (e.g., 3D visualization, graph analysis algorithms, etc). Here are a few other toolkits / applications that might be relevant:
- Piccolo - A Java toolkit for structured 2D graphics using a scenegraph abstraction.
- Processing - A graphics library and IDE serving as an artist's digital sketchbook.
- The Visualization Toolkit (VTK) - A 3D graphics and visualization toolkit.
- JUNG - A Java graph processing and visualization library.
- The InfoVis Toolkit - A Java toolkit supporting a number of visualization techniques.
- Improvise - An application for end-user authoring of interactive visualizations.
- Where did the "prefuse" name come from?
Prefuse intially began as a set of support classes for an experiment with different visualization algorithms, pursued within CS270, a graduate computer theory course at UC Berkeley. At the time, we (Alan Newberger and I) were listening to the electronica / hip-hop musician prefuse 73. The initial commit of the classes to a CVS repository forced us to give them a name. Following a sort of "you-are-what-you-eat" logic we named it after what we happened to be listening to at the time. Once enshrined as the name of the CVS module, the "prefuse" name stuck. Warp Records was even kind enough to provide permission to use the prefuse 73 track "Storm Returns" in the original prefuse demo video.
The name has since been rationalized in various ways. Java user interface toolkits have typically taken a musical naming theme (e.g., Swing, Jazz, and Piccolo are all Java interface toolkits), so the name works within that convention. Prefuse development also often involves "fusing" together a number of "pre"-built components. Best of all, it is pronounced such that it sounds like "refuse", lending a (hopefully) healthy level of self-deprecation.
- What is prefuse? What can I do with it?
- How can I get my visualization to run
There are many ways performance might be improved. Sometimes data processing is to blame for slowdowns (e.g., layout computation, item processing). In these cases it can often help to either find ways to move data processing out of an "inner loop" condition (if possible) or to find ways to process fewer data items by limiting operations to a filtered set of data. If you are regularly issuing queries (via Predicate filters) to data sets, it might help to index the data columns referenced by the Predicate. This can be done using the index() method of the Table class.
More commonly however, performance slow down is due to rendering bottlenecks. If you are rendering thousands of items, animation is likely to slow down and a more stationary visualization might be more appropriate (dragging items around should still be fairly quick due to damage/redraw optimizations). Another approach is to use simpler shapes. Straight lines and rectangles will draw much faster than curved or other more complicated shapes.
To see for yourself how rendering performance can vary, try running the RenderingBenchmarks class in the test directory of the prefuse distribution.
- Why are some items in my visualization
leaving "trails" behind them?
Most likely this is a result of optimization gone wrong. By default, prefuse Displays used an optimization technique called "damage/redraw" where only the region of the display that has changed since the last repaint is redrawn. For this to work correctly, all VisualItems must accurately report their bounding boxes, so that the "damaged" region is computed accurately. If the reported bounding box is smaller than what is actually drawn, this inaccuracy can lead to rendering artifacts such as "trails". Potentially, this could be due to a bug in the setBounds method of the Renderer instance being used to draw the item. If you have created a custom Renderer, check for this first. However, errors are also known to occur when drawing images (as opposed to just shapes or text). Sometimes Java2D's optimized image rendering actually results in an inaccurate clearing of the damaged region. This is unfortunate, as the only sure-fire solution known at this time is to disable the damage/redraw optimization. This can be done using the setDamageRedraw method in the Display class.
- How can I get my visualization to run faster?
Support and Contribution
- Where can I go to get help?
If you don't find a satisfactory answer in this FAQ, you can turn to the Help Forum on SourceForge. Please first read through and see if your question has been addressed there. If not, please post your question there so that the community can share in the answer. You will need to create a SourceForge account to post to the forum.
- I think I found a bug, how can I submit a report?
- How can I submit a bug fix or a new feature?
You can e-mail suggested bug fixes or new feature implementations to prefuse-admin (at) lists (dot) sourceforge (dot) net. New features may or may not be incorporated into the toolkit proper, if not, they can be shared as external extensions available from the prefuse website. Also feel free to post it to the Help Forum.
- How can I get my visualization included
in the gallery?
Send an e-mail to prefuse-admin (at) lists (dot) sourceforge (dot) net, including a description of your visualization, a link to a project website, and a 300x150 pixel representative image of your visualization. Your submission will be reviewed and likely added to the online gallery. Please be sure that you are the copyright holder (or have the requisite permission) for your submitted image.
- Can I become a developer on the project, with write access to the repository?
Maybe. Start up a dialog by e-mailing prefuse-admin (at) lists (dot) sourceforge (dot) net.
- Where can I go to get help?