Class EMClusterVisualization.Instance
- java.lang.Object
-
- elki.visualization.visualizers.AbstractVisualization
-
- elki.visualization.visualizers.scatterplot.AbstractScatterplotVisualization
-
- elki.visualization.visualizers.scatterplot.cluster.EMClusterVisualization.Instance
-
- All Implemented Interfaces:
DataStoreListener
,ResultListener
,VisualizationListener
,Visualization
,java.util.EventListener
- Enclosing class:
- EMClusterVisualization
public static class EMClusterVisualization.Instance extends AbstractScatterplotVisualization
Instance.- Author:
- Robert Rödler
-
-
Field Summary
Fields Modifier and Type Field Description private int
drawStyle
Round or boxed.static java.lang.String
EMBORDER
Generic tags to indicate the type of element.private static double
KAPPA
Kappa constant.private static double
MKAPPA
Minus Kappa constant.private int
opacStyle
Opacityprivate int
softBorder
Soft or hard border-
Fields inherited from class elki.visualization.visualizers.scatterplot.AbstractScatterplotVisualization
proj, rel, sample
-
Fields inherited from class elki.visualization.visualizers.AbstractVisualization
context, layer, svgp, task
-
-
Constructor Summary
Constructors Constructor Description Instance(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
drawArc(SVGPath path, double[] cent, double[] pre, double[] nex, double[] oPrev, double[] oNext, double scale)
Draw an arc to simulate the hyper ellipse.protected void
drawHullArc(java.lang.String sname, double[] cent, Polygon chres)
Approximate the hull using arcs.protected void
drawHullLines(java.lang.String sname, double[] cent, Polygon chres)
Approximate by convex hull.protected void
drawSphere2D(java.lang.String sname, double[] cent, double[][] pc)
Draw by approximating a sphere via cubic splinesprivate double[]
equalsPlusTimes(double[] out, double[] x, double[] y, double a)
Compute out = x + y * a, for 2d.void
fullRedraw()
Request a full redrawing of the visualization.protected Polygon
makeHull(double[][] pc)
Build a convex hull to approximate the sphere.protected Polygon
makeHullComplex(double[][] pc)
Build a convex hull to approximate the sphere.-
Methods inherited from class elki.visualization.visualizers.scatterplot.AbstractScatterplotVisualization
setupCanvas, setupCanvas, visualizationChanged
-
Methods inherited from class elki.visualization.visualizers.AbstractVisualization
addListeners, contentChanged, destroy, getHeight, getLayer, getWidth, incrementalRedraw, resultChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.result.ResultListener
resultAdded, resultRemoved
-
-
-
-
Field Detail
-
EMBORDER
public static final java.lang.String EMBORDER
Generic tags to indicate the type of element. Used in IDs, CSS-Classes etc.- See Also:
- Constant Field Values
-
KAPPA
private static final double KAPPA
Kappa constant.- See Also:
- Constant Field Values
-
MKAPPA
private static final double MKAPPA
Minus Kappa constant.- See Also:
- Constant Field Values
-
opacStyle
private int opacStyle
Opacity
-
softBorder
private int softBorder
Soft or hard border
-
drawStyle
private int drawStyle
Round or boxed.
-
-
Constructor Detail
-
Instance
public Instance(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)
Constructor- Parameters:
context
- Visualizer contexttask
- VisualizationTaskplot
- Plot to draw towidth
- Embedding widthheight
- Embedding heightproj
- Projection
-
-
Method Detail
-
fullRedraw
public void fullRedraw()
Description copied from interface:Visualization
Request a full redrawing of the visualization.- Specified by:
fullRedraw
in interfaceVisualization
- Specified by:
fullRedraw
in classAbstractVisualization
-
drawSphere2D
protected void drawSphere2D(java.lang.String sname, double[] cent, double[][] pc)
Draw by approximating a sphere via cubic splines- Parameters:
sname
- CSS class namecent
- centerpc
- Principal components
-
equalsPlusTimes
private double[] equalsPlusTimes(double[] out, double[] x, double[] y, double a)
Compute out = x + y * a, for 2d.- Parameters:
out
- Output bufferx
- Xy
- Ya
- Scaling- Returns:
- out
-
drawHullLines
protected void drawHullLines(java.lang.String sname, double[] cent, Polygon chres)
Approximate by convex hull.- Parameters:
sname
- CSS namecent
- centerchres
- Polygon around center
-
makeHull
protected Polygon makeHull(double[][] pc)
Build a convex hull to approximate the sphere.- Parameters:
pc
- Principal components- Returns:
- Polygon
-
makeHullComplex
protected Polygon makeHullComplex(double[][] pc)
Build a convex hull to approximate the sphere.- Parameters:
pc
- Principal components- Returns:
- Polygon
-
drawHullArc
protected void drawHullArc(java.lang.String sname, double[] cent, Polygon chres)
Approximate the hull using arcs.- Parameters:
sname
- CSS namecent
- Centerchres
- Polygon
-
drawArc
private void drawArc(SVGPath path, double[] cent, double[] pre, double[] nex, double[] oPrev, double[] oNext, double scale)
Draw an arc to simulate the hyper ellipse.- Parameters:
path
- Path to draw tocent
- Centerpre
- Previous pointnex
- Next pointscale
- Scaling factor
-
-