prefuse.action.layout
Class StackedAreaChart

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.StackedAreaChart

public class StackedAreaChart
extends Layout

Layout Action that computes a stacked area chart, in which a series of data values are consecutively stacked on top of each other.

Author:
jeffrey heer

Field Summary
 
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
StackedAreaChart(java.lang.String group, java.lang.String field, java.lang.String[] columns)
          Create a new StackedAreaChart.
StackedAreaChart(java.lang.String group, java.lang.String field, java.lang.String[] columns, double threshold)
          Create a new StackedAreaChart.
 
Method Summary
 int getOrientation()
          Returns the orientation of this layout.
 double getPaddingPercentage()
          Gets the percentage of the layout bounds that should be reserved for empty space at the top of the stack.
 ValuedRangeModel getRangeModel()
          Get the range model describing the range occupied by the value stack.
 double getThreshold()
          Get the minimum height threshold under which stacks should not be made visible.
 boolean isNormalized()
          Indicates if the stacks are normalized, such that each column is independently scaled.
 void run(double frac)
          Runs this Action, triggering whatever processing this Action performs.
 void setColumns(java.lang.String[] cols)
          Set the data columns used to compute the stacked layout
 void setNormalized(boolean b)
          Sets if the stacks are normalized, such that each column is independently scaled.
 void setOrientation(int orient)
          Sets the orientation of this layout.
 void setPaddingPercentage(double p)
          Sets the percentage of the layout bounds that should be reserved for empty space at the top of the stack.
 void setThreshold(double threshold)
          Set the minimum height threshold under which stacks should not be made visible.
 
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
 

Constructor Detail

StackedAreaChart

public StackedAreaChart(java.lang.String group,
                        java.lang.String field,
                        java.lang.String[] columns)
Create a new StackedAreaChart.

Parameters:
group - the data group to layout
field - the data field in which to store computed polygons
columns - the various data fields, in sorted order, that should be referenced for each consecutive point of a stack layer

StackedAreaChart

public StackedAreaChart(java.lang.String group,
                        java.lang.String field,
                        java.lang.String[] columns,
                        double threshold)
Create a new StackedAreaChart.

Parameters:
group - the data group to layout
field - the data field in which to store computed polygons
columns - the various data fields, in sorted order, that should be referenced for each consecutive point of a stack layer
threshold - height threshold under which stacks should not be made visible.
Method Detail

setColumns

public void setColumns(java.lang.String[] cols)
Set the data columns used to compute the stacked layout

Parameters:
cols - the various data fields, in sorted order, that should be referenced for each consecutive point of a stack layer

setNormalized

public void setNormalized(boolean b)
Sets if the stacks are normalized, such that each column is independently scaled.

Parameters:
b - true to normalize, false otherwise

isNormalized

public boolean isNormalized()
Indicates if the stacks are normalized, such that each column is independently scaled.

Returns:
true if normalized, false otherwise

getPaddingPercentage

public double getPaddingPercentage()
Gets the percentage of the layout bounds that should be reserved for empty space at the top of the stack.

Returns:
the padding percentage

setPaddingPercentage

public void setPaddingPercentage(double p)
Sets the percentage of the layout bounds that should be reserved for empty space at the top of the stack.

Parameters:
p - the padding percentage to use

getThreshold

public double getThreshold()
Get the minimum height threshold under which stacks should not be made visible.

Returns:
the minimum height threshold for visibility

setThreshold

public void setThreshold(double threshold)
Set the minimum height threshold under which stacks should not be made visible.

Parameters:
threshold - the minimum height threshold for visibility to use

getRangeModel

public ValuedRangeModel getRangeModel()
Get the range model describing the range occupied by the value stack.

Returns:
the stack range model

getOrientation

public int getOrientation()
Returns the orientation of this layout. One of Constants.ORIENT_BOTTOM_TOP (to grow bottom-up), Constants.ORIENT_TOP_BOTTOM (to grow top-down), Constants.ORIENT_LEFT_RIGHT (to grow left-right), or Constants.ORIENT_RIGHT_LEFT (to grow right-left).

Returns:
the orientation of this layout

setOrientation

public void setOrientation(int orient)
Sets the orientation of this layout. Must be one of Constants.ORIENT_BOTTOM_TOP (to grow bottom-up), Constants.ORIENT_TOP_BOTTOM (to grow top-down), Constants.ORIENT_LEFT_RIGHT (to grow left-right), or Constants.ORIENT_RIGHT_LEFT (to grow right-left).

Parameters:
orient - the desired orientation of this layout
Throws:
java.lang.IllegalArgumentException - if the orientation value is not a valid value

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