Package elki.visualization.opticsplot
Class OPTICSPlot
- java.lang.Object
-
- elki.visualization.opticsplot.OPTICSPlot
-
public class OPTICSPlot extends java.lang.ObjectClass to produce an OPTICS plot image.- Since:
- 0.3
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ClusterOrdercoThe result to plot.(package private) StylingPolicycolorsColor adapter to use(package private) intheightHeight of plotprivate static LoggingLOGLoggerprivate static intMAX_HEIGHTMinimum and maximum vertical resolution.private static intMIN_HEIGHTMinimum and maximum vertical resolution.protected java.awt.image.RenderedImageplotThe Optics plot.protected intplotnumThe plot number for Batik(package private) doubleratioRatio of plot(package private) LinearScalescaleScale to use(package private) intwidthWidth of plot
-
Constructor Summary
Constructors Constructor Description OPTICSPlot(ClusterOrder co, StylingPolicy colors)Constructor, with automatic distance adapter detection.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LinearScalecomputeScale(ClusterOrder order)Compute the scale (value range)voidforgetRenderedImage()Free memory used by rendered image.ClusterOrdergetClusterOrder()Get the cluster order we are attached to.intgetHeight()java.lang.StringgetLongName()java.awt.image.RenderedImagegetPlot()Get the OPTICS plot.doublegetRatio()Get width-to-height ratio of image.LinearScalegetScale()java.lang.StringgetShortName()java.lang.StringgetSVGPlotURI()Get the SVG registered plot numberintgetWidth()static OPTICSPlotplotForClusterOrder(ClusterOrder co, VisualizerContext context)Static method to find an optics plot for a result, or to create a new one using the given context.voidreplot()Trigger a redraw of the OPTICS plotdoublescaleFromPixel(double y)Scale a pixel value to a reachabilityintscaleToPixel(double reach)Scale a reachability distance to a pixel value.
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Logger
-
MIN_HEIGHT
private static final int MIN_HEIGHT
Minimum and maximum vertical resolution.- See Also:
- Constant Field Values
-
MAX_HEIGHT
private static final int MAX_HEIGHT
Minimum and maximum vertical resolution.- See Also:
- Constant Field Values
-
scale
LinearScale scale
Scale to use
-
width
int width
Width of plot
-
height
int height
Height of plot
-
ratio
double ratio
Ratio of plot
-
co
final ClusterOrder co
The result to plot.
-
colors
final StylingPolicy colors
Color adapter to use
-
plot
protected java.awt.image.RenderedImage plot
The Optics plot.
-
plotnum
protected int plotnum
The plot number for Batik
-
-
Constructor Detail
-
OPTICSPlot
public OPTICSPlot(ClusterOrder co, StylingPolicy colors)
Constructor, with automatic distance adapter detection.- Parameters:
co- Cluster order to plot.colors- Coloring strategy
-
-
Method Detail
-
replot
public void replot()
Trigger a redraw of the OPTICS plot
-
scaleToPixel
public int scaleToPixel(double reach)
Scale a reachability distance to a pixel value.- Parameters:
reach- Reachability- Returns:
- Pixel value.
-
scaleFromPixel
public double scaleFromPixel(double y)
Scale a pixel value to a reachability- Parameters:
y- Pixel value- Returns:
- Reachability
-
computeScale
protected LinearScale computeScale(ClusterOrder order)
Compute the scale (value range)- Parameters:
order- Cluster order to process- Returns:
- Scale for value range of cluster order
-
getScale
public LinearScale getScale()
- Returns:
- the scale
-
getWidth
public int getWidth()
- Returns:
- the width
-
getHeight
public int getHeight()
- Returns:
- the height
-
getRatio
public double getRatio()
Get width-to-height ratio of image.- Returns:
width / height
-
getPlot
public java.awt.image.RenderedImage getPlot()
Get the OPTICS plot.- Returns:
- plot image
-
forgetRenderedImage
public void forgetRenderedImage()
Free memory used by rendered image.
-
getSVGPlotURI
public java.lang.String getSVGPlotURI()
Get the SVG registered plot number- Returns:
- Plot URI
-
getLongName
public java.lang.String getLongName()
-
getShortName
public java.lang.String getShortName()
-
plotForClusterOrder
public static OPTICSPlot plotForClusterOrder(ClusterOrder co, VisualizerContext context)
Static method to find an optics plot for a result, or to create a new one using the given context.- Parameters:
co- Cluster ordercontext- Context (for colors and reference clustering)- Returns:
- New or existing optics plot
-
getClusterOrder
public ClusterOrder getClusterOrder()
Get the cluster order we are attached to.- Returns:
- Cluster order
-
-