This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
java:prefuse-scatterplot [2009/08/17 16:38] Alexander Rind Warning about mixing group names for axis labels |
java:prefuse-scatterplot [2009/10/05 15:52] Alexander Rind some updates |
||
---|---|---|---|
Line 7: | Line 7: | ||
Further, it discusses an axis-based visualization technique, whereas the documentation of prefuse focuses on graph visualization. | Further, it discusses an axis-based visualization technique, whereas the documentation of prefuse focuses on graph visualization. | ||
The demo application is inspired by Jeffrey Heer's Congress demo, but achieves its functionality in small incremental steps. | The demo application is inspired by Jeffrey Heer's Congress demo, but achieves its functionality in small incremental steps. | ||
+ | ((Please [[http://ike.donau-uni.ac.at/~rind/ | let me know]], if you spot any errors or misleading information.)) | ||
+ | |||
+ | ===== Introduction ===== | ||
+ | |||
+ | Developing with prefuse is for the most part configuration. | ||
+ | You can achieve both basic and advanced visualizations simply by creating objects and setting their properties. | ||
+ | However, this makes it very easy produce source code that is hard to understand. | ||
+ | |||
+ | I recommend to structure your prefuse configuration in four parts: | ||
+ | * data setup | ||
+ | * renderers | ||
+ | * action lists | ||
+ | * displays and controls | ||
===== Phase 0: Infrastructure ===== | ===== Phase 0: Infrastructure ===== | ||
Line 114: | Line 127: | ||
{{:java:scatterplot1.java|Source Code}} | {{:java:scatterplot1.java|Source Code}} | ||
+ | |||
+ | === Further Information === | ||
+ | |||
+ | __Alternative:__ Our visualization class can also be a subclass of either [[http://prefuse.org/doc/api/prefuse/Visualization.html | Visualization]] or [[http://prefuse.org/doc/api/prefuse/Display.html | Display]] instead of referencing them. | ||
+ | |||
+ | __Note:__ A [[http://prefuse.org/doc/api/prefuse/Visualization.html | Visualization]] objects can handle multiple [[http://prefuse.org/doc/api/prefuse/Display.html | Display]]. However, in some situation prefuse only takes the first display in account -- it is still beta. | ||
===== Phase 2: Refinements ===== | ===== Phase 2: Refinements ===== | ||
Line 291: | Line 310: | ||
{{:java:scatterplot4.java|Source Code}} | {{:java:scatterplot4.java|Source Code}} | ||
+ | |||
+ | === Further Information === | ||
+ | |||
+ | __Warning:__ Panning and Zooming doesn't work as one might expect: it simply performs a geometric transformation of the display. | ||
+ | |||
+ | __Alternative:__ Using range sliders is an possible alternative to zoom and pan. | ||
+ | However the underlying interaction metaphor is different and can be harder to understand. | ||
===== Phase 5: Refinements on axes ===== | ===== Phase 5: Refinements on axes ===== | ||
Line 347: | Line 373: | ||
* We do not need the empty border defined in phase 2 anymore. | * We do not need the empty border defined in phase 2 anymore. | ||
* Now we or someone else using the [[http://prefuse.org/doc/api/prefuse/Display.html | Display]] can add a border, and items at the edge of the visualization (especially axis labels) stay completely visible. | * Now we or someone else using the [[http://prefuse.org/doc/api/prefuse/Display.html | Display]] can add a border, and items at the edge of the visualization (especially axis labels) stay completely visible. | ||
- | |||
- | __Note:__ If [[http://prefuse.org/doc/api/prefuse/render/AxisRenderer.html | AxisRenderer]] have the ''FAR_LEFT'', ''FAR_RIGHT'', ''FAR_TOP'', or ''FAR_BOTTOM'', the grid lines will fill the bounding box completely and labels will be placed outside :!: the bounding box. | ||
- | |||
- | __Warning:__ Be careful, prefuse will not stop you from designing misleading visualizations, if the bounding boxes of data and axes are not correctly aligned :!: | ||
First, we define three rectangles for the visualization of the data and both axes. | First, we define three rectangles for the visualization of the data and both axes. | ||
- | |||
- | __Note:__ The variables are final so that they are accessible from inner classes. Alternatively they could be defined as instance variables. | ||
<code java> | <code java> | ||
Line 432: | Line 452: | ||
{{:java:scatterplot6.java|Source Code}} | {{:java:scatterplot6.java|Source Code}} | ||
+ | |||
+ | === Further Information === | ||
+ | |||
+ | __Note:__ If [[http://prefuse.org/doc/api/prefuse/render/AxisRenderer.html | AxisRenderer]] have the ''FAR_LEFT'', ''FAR_RIGHT'', ''FAR_TOP'', or ''FAR_BOTTOM'', the grid lines will fill the bounding box completely and labels will be placed outside :!: the bounding box. | ||
+ | |||
+ | __Warning:__ Be careful, prefuse will not stop you from designing misleading visualizations, if the bounding boxes of data and axes are not correctly aligned :!: | ||
+ | |||
+ | __Note:__ The bounding rectangles are final variables so that they are accessible from inner classes. | ||
+ | Alternatively they could be defined as instance variables. | ||
+ | |||
+ | __Alternative:__ Instead of the method ''updateBounds()'', we can write an action that takes care of updating the bounding rectangles. | ||
+ | Then, this task can be included in the ''update'' action list. | ||
+ | |||
alex @ ieg: home about me publications research