Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.visualization.visualizers.vis2d
Class TooltipVisualizer<NV extends NumberVector<NV,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.visualization.visualizers.AbstractVisualizer
          extended by de.lmu.ifi.dbs.elki.visualization.visualizers.vis2d.Projection2DVisualizer<NV>
              extended by de.lmu.ifi.dbs.elki.visualization.visualizers.vis2d.TooltipVisualizer<NV>
Type Parameters:
NV - Data type visualized.
All Implemented Interfaces:
Parameterizable, ProjectedVisualizer, Visualizer

public class TooltipVisualizer<NV extends NumberVector<NV,?>>
extends Projection2DVisualizer<NV>

Generates a SVG-Element containing Tooltips. Tooltips remain invisible until their corresponding Marker is touched by the cursor and stay visible as long as the cursor lingers on the marker.

Author:
Remigius Wojdanowski

Field Summary
private  AnnotationResult<? extends Number> anResult
          Contains the "outlierness-scores" to be displayed as Tooltips.
static OptionID DIGITS_ID
          OptionID for DIGITS_PARAM.
private  IntParameter DIGITS_PARAM
          Parameter for the gamma-correction.
static String NAME
          A short name characterizing this Visualizer.
(package private)  NumberFormat nf
          Number formatter used for visualization
static String TOOLTIP_AREA
          Generic tag to indicate the type of element.
static String TOOLTIP_HIDDEN
          Generic tag to indicate the type of element.
static String TOOLTIP_STICKY
          Generic tag to indicate the type of element.
static String TOOLTIP_VISIBLE
          Generic tag to indicate the type of element.
 
Fields inherited from class de.lmu.ifi.dbs.elki.visualization.visualizers.AbstractVisualizer
context, metadata
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Fields inherited from interface de.lmu.ifi.dbs.elki.visualization.visualizers.Visualizer
LEVEL_BACKGROUND, LEVEL_FOREGROUND, LEVEL_INTERACTIVE, LEVEL_STATIC, META_LEVEL, META_NAME, META_NOTHUMB, META_VISIBLE, META_VISIBLE_DEFAULT
 
Constructor Summary
TooltipVisualizer(Parameterization config)
          Constructor, adhering to Parameterizable
 
Method Summary
private  Number getValue(int id)
          Returns the outlierness-score for a given ID.
protected  void handleHoverevent(Event evt)
          Handle the hover events.
 void init(String name, VisualizerContext context, OutlierResult result)
          Initializes this Visualizer.
private  void setupCSS(SVGPlot svgp)
          Registers the Tooltip-CSS-Class at a SVGPlot.
protected  void toggleTooltip(Element elem, String type)
          Toggle the Tooltip of an element.
 Element visualize(SVGPlot svgp, VisualizationProjection proj, double width, double height)
          Returns an Element representing a visualization.
 
Methods inherited from class de.lmu.ifi.dbs.elki.visualization.visualizers.vis2d.Projection2DVisualizer
setupCanvas
 
Methods inherited from class de.lmu.ifi.dbs.elki.visualization.visualizers.AbstractVisualizer
addRedrawListener, fireRedrawEvent, getMetadata, init, removeRedrawListener, requestRedraw, setLevel
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.visualization.visualizers.Visualizer
addRedrawListener, getMetadata, removeRedrawListener
 

Field Detail

DIGITS_ID

public static final OptionID DIGITS_ID
OptionID for DIGITS_PARAM.


DIGITS_PARAM

private final IntParameter DIGITS_PARAM
Parameter for the gamma-correction.

Key: -tooltip.digits

Default value: 4 < /p>


NAME

public static final String NAME
A short name characterizing this Visualizer.

See Also:
Constant Field Values

TOOLTIP_HIDDEN

public static final String TOOLTIP_HIDDEN
Generic tag to indicate the type of element. Used in IDs, CSS-Classes etc.

See Also:
Constant Field Values

TOOLTIP_VISIBLE

public static final String TOOLTIP_VISIBLE
Generic tag to indicate the type of element. Used in IDs, CSS-Classes etc.

See Also:
Constant Field Values

TOOLTIP_STICKY

public static final String TOOLTIP_STICKY
Generic tag to indicate the type of element. Used in IDs, CSS-Classes etc.

See Also:
Constant Field Values

TOOLTIP_AREA

public static final String TOOLTIP_AREA
Generic tag to indicate the type of element. Used in IDs, CSS-Classes etc.

See Also:
Constant Field Values

anResult

private AnnotationResult<? extends Number> anResult
Contains the "outlierness-scores" to be displayed as Tooltips. If this result does not contain all IDs the database contains, behavior is undefined.


nf

NumberFormat nf
Number formatter used for visualization

Constructor Detail

TooltipVisualizer

public TooltipVisualizer(Parameterization config)
Constructor, adhering to Parameterizable

Parameters:
config - Parameterization
Method Detail

getValue

private Number getValue(int id)
Returns the outlierness-score for a given ID. If there is no corresponding score, behavior is undefined.

Parameters:
id - an ID which has to exist in both the database and the result.
Returns:
the outlierness-score for a given ID.

init

public void init(String name,
                 VisualizerContext context,
                 OutlierResult result)
Initializes this Visualizer.

Parameters:
name - Visualizer name
context - Visualization context
result - the outlier score visualized

setupCSS

private void setupCSS(SVGPlot svgp)
Registers the Tooltip-CSS-Class at a SVGPlot.

Parameters:
svgp - the SVGPlot to register the Tooltip-CSS-Class.

visualize

public Element visualize(SVGPlot svgp,
                         VisualizationProjection proj,
                         double width,
                         double height)
Description copied from interface: ProjectedVisualizer
Returns an Element representing a visualization.

Parameters:
svgp - plot to contain the returned Element.
proj - projection to use
width - Width of plot
height - Height of plot
Returns:
an Element representing a 2-dimensional visualization.

handleHoverevent

protected void handleHoverevent(Event evt)
Handle the hover events.

Parameters:
evt - Event.

toggleTooltip

protected void toggleTooltip(Element elem,
                             String type)
Toggle the Tooltip of an element.

Parameters:
elem - Element
type - Event type

Release 0.3 (2010-03-31_1612)