prefuse.action.layout.graph
Class SquarifiedTreeMapLayout

java.lang.Object
  extended by prefuse.activity.Activity
      extended by prefuse.action.Action
          extended by prefuse.action.GroupAction
              extended by prefuse.action.layout.Layout
                  extended by prefuse.action.layout.graph.TreeLayout
                      extended by prefuse.action.layout.graph.SquarifiedTreeMapLayout

public class SquarifiedTreeMapLayout
extends TreeLayout

TreeLayout instance computing a TreeMap layout that optimizes for low aspect ratios of visualized tree nodes. TreeMaps are a form of space-filling layout that represents nodes as boxes on the display, with children nodes represented as boxes placed within their parent's box.

This particular algorithm is taken from Bruls, D.M., C. Huizing, and J.J. van Wijk, "Squarified Treemaps" In Data Visualization 2000, Proceedings of the Joint Eurographics and IEEE TCVG Sumposium on Visualization, 2000, pp. 33-42. Available online at: http://www.win.tue.nl/~vanwijk/stm.pdf.

For more information on TreeMaps in general, see http://www.cs.umd.edu/hcil/treemap-history/.

Version:
1.0
Author:
jeffrey heer

Field Summary
static java.lang.String AREA
           
static Schema AREA_SCHEMA
           
 
Fields inherited from class prefuse.action.layout.graph.TreeLayout
m_root
 
Fields inherited from class prefuse.action.layout.Layout
m_anchor, m_bounds, m_bpts, m_insets, m_margin, m_tmpa, m_tmpb
 
Fields inherited from class prefuse.action.GroupAction
m_group
 
Fields inherited from class prefuse.action.Action
m_vis
 
Fields inherited from class prefuse.activity.Activity
DEFAULT_STEP_TIME, INFINITY
 
Constructor Summary
SquarifiedTreeMapLayout(java.lang.String group)
          Creates a new SquarifiedTreeMapLayout with no spacing between parent areas and their enclosed children.
SquarifiedTreeMapLayout(java.lang.String group, double frame)
          Creates a new SquarifiedTreeMapLayout with the specified spacing between parent areas and their enclosed children.
 
Method Summary
 double getFrameWidth()
          Gets the amount of desired framing space, in pixels, between parent rectangles and their enclosed children.
 void run(double frac)
          Runs this Action, triggering whatever processing this Action performs.
 void setFrameWidth(double frame)
          Sets the amount of desired framing space between parent rectangles and their enclosed children.
 
Methods inherited from class prefuse.action.layout.graph.TreeLayout
getLayoutRoot, setLayoutRoot
 
Methods inherited from class prefuse.action.layout.Layout
getLayoutAnchor, getLayoutBounds, setLayoutAnchor, setLayoutBounds, setMargin, setX, setY
 
Methods inherited from class prefuse.action.GroupAction
getGroup, setGroup
 
Methods inherited from class prefuse.action.Action
getVisualization, run, setVisualization
 
Methods inherited from class prefuse.activity.Activity
addActivityListener, alwaysRunAfter, cancel, fireActivityCancelled, fireActivityFinished, fireActivityScheduled, fireActivityStarted, fireActivityStepped, getDuration, getNextTime, getPace, getPacingFunction, getStartTime, getStepTime, getStopTime, isEnabled, isRunning, isScheduled, removeActivityListener, run, runAfter, runAt, setDuration, setEnabled, setPacingFunction, setStartTime, setStepTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AREA

public static final java.lang.String AREA
See Also:
Constant Field Values

AREA_SCHEMA

public static final Schema AREA_SCHEMA
Constructor Detail

SquarifiedTreeMapLayout

public SquarifiedTreeMapLayout(java.lang.String group)
Creates a new SquarifiedTreeMapLayout with no spacing between parent areas and their enclosed children.

Parameters:
group - the data group to layout. Must resolve to a Graph instance.

SquarifiedTreeMapLayout

public SquarifiedTreeMapLayout(java.lang.String group,
                               double frame)
Creates a new SquarifiedTreeMapLayout with the specified spacing between parent areas and their enclosed children.

Parameters:
frame - the amount of desired framing space between parent areas and their enclosed children.
group - the data group to layout. Must resolve to a Graph instance.
Method Detail

setFrameWidth

public void setFrameWidth(double frame)
Sets the amount of desired framing space between parent rectangles and their enclosed children. Use a value of 0 to remove frames altogether. If you adjust the frame value, you must re-run the layout to see the change reflected. Negative frame values are not allowed and will result in an IllegalArgumentException.

Parameters:
frame - the frame width, 0 for no frames

getFrameWidth

public double getFrameWidth()
Gets the amount of desired framing space, in pixels, between parent rectangles and their enclosed children.

Returns:
the frame width

run

public void run(double frac)
Description copied from class: Action
Runs this Action, triggering whatever processing this Action performs. Subclass this method to create custom Actions.

Specified by:
run in class GroupAction
Parameters:
frac - the fraction of this Action's duration that has elapsed.
See Also:
Action.run(double)


Copyright © 2007 Regents of the University of California