User Tools

Site Tools


java:prefuse-scatterplot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
java:prefuse-scatterplot [2009/08/17 13:25]
Alexander Rind alternative renderer factory (equivalent to previous solution)
java:prefuse-scatterplot [2009/08/17 16:38]
Alexander Rind Warning about mixing group names for axis labels
Line 189: Line 189:
  }  }
  });  });
-</​code>​ 
- 
-__Note:__ Instead of extending RendererFactory,​ we can use [[http://​prefuse.org/​doc/​api/​prefuse/​render/​DefaultRendererFactory.html | DefaultRendererFactory]]. In this case we use predicates to identify the axes.  
- 
-<code java> 
- DefaultRendererFactory rf = new DefaultRendererFactory(); ​ 
- rf.setDefaultRenderer(new ShapeRenderer(7));​ 
- rf.add(new InGroupPredicate("​ylab"​), ​ 
- new AxisRenderer(Constants.FAR_LEFT,​ Constants.CENTER));​ 
- rf.add(new InGroupPredicate("​xlab"​), ​ 
- new AxisRenderer(Constants.CENTER,​ Constants.FAR_BOTTOM));​ 
- vis.setRendererFactory(rf);​ 
 </​code>​ </​code>​
  
 Second, we create two instances of [[http://​prefuse.org/​doc/​api/​prefuse/​action/​layout/​AxisLabelLayout.html | AxisLabelLayout]] and initialize them with the [[http://​prefuse.org/​doc/​api/​prefuse/​action/​layout/​AxisLayout.html | AxisLayouts]]. ​ Second, we create two instances of [[http://​prefuse.org/​doc/​api/​prefuse/​action/​layout/​AxisLabelLayout.html | AxisLabelLayout]] and initialize them with the [[http://​prefuse.org/​doc/​api/​prefuse/​action/​layout/​AxisLayout.html | AxisLayouts]]. ​
- 
-When these layout actions are run, they generate new visual items for the axis labels. 
  
 <code java> <code java>
Line 239: Line 225:
 {{:​java:​scatterplot3.java|Source Code}} {{:​java:​scatterplot3.java|Source Code}}
  
 +=== Further Information ===
 +
 +__Alternative:​__ Instead of extending RendererFactory,​ we can use [[http://​prefuse.org/​doc/​api/​prefuse/​render/​DefaultRendererFactory.html | DefaultRendererFactory]]. ​
 +In this case we use predicates to identify the axes. 
 +
 +<code java>
 + DefaultRendererFactory rf = new DefaultRendererFactory(); ​
 + rf.setDefaultRenderer(new ShapeRenderer(7));​
 + rf.add(new InGroupPredicate("​ylab"​), ​
 + new AxisRenderer(Constants.FAR_LEFT,​ Constants.CENTER));​
 + rf.add(new InGroupPredicate("​xlab"​), ​
 + new AxisRenderer(Constants.CENTER,​ Constants.FAR_BOTTOM));​
 + vis.setRendererFactory(rf);​
 +</​code>​
 +
 +
 +__Warning:​__ When the [[http://​prefuse.org/​doc/​api/​prefuse/​action/​layout/​AxisLabelLayout.html | AxisLabelLayout]] actions are run, 
 +they generate new visual items for the axis labels. ​
 +
 +"​xlab"​ and "​xlab"​ are the group names of these visual items. ​
 +Do not put the group name of your data here!
  
 ===== Phase 4: Interactivity ===== ===== Phase 4: Interactivity =====
java/prefuse-scatterplot.txt · Last modified: 2009/10/05 15:52 by Alexander Rind

alex @ ieg: home about me publications research