Package elki.visualization.projections
Class Simple2D
- java.lang.Object
-
- elki.visualization.projections.AbstractProjection
-
- elki.visualization.projections.AbstractFullProjection
-
- elki.visualization.projections.AbstractSimpleProjection
-
- elki.visualization.projections.Simple2D
-
- All Implemented Interfaces:
FullProjection
,Projection
,Projection2D
,VisualizationItem
public class Simple2D extends AbstractSimpleProjection implements Projection2D
Dimension-selecting 2D projection.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private int
dim1
Dimensions for fast projection mode.private int
dim2
Dimensions for fast projection mode.-
Fields inherited from class elki.visualization.projections.AbstractProjection
scales
-
Fields inherited from interface elki.visualization.projections.Projection
INVSCALE, SCALE
-
-
Constructor Summary
Constructors Constructor Description Simple2D(Projector p, LinearScale[] scales, int ax1, int ax2)
Constructor with a given database and axes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double[]
dearrange(double[] v)
Undo the rearrangement of components.CanvasSize
estimateViewport()
Estimate the viewport requirementsdouble[]
fastProjectDataToRenderSpace(double[] data)
Project a data vector from data space to rendering space.double[]
fastProjectDataToRenderSpace(NumberVector data)
Project a data vector from data space to rendering space.double[]
fastProjectDataToScaledSpace(double[] data)
Project a data vector from data space to scaled space.double[]
fastProjectDataToScaledSpace(NumberVector data)
Project a data vector from data space to scaled space.double[]
fastProjectRelativeDataToRenderSpace(double[] data)
Project a data vector from data space to rendering space.double[]
fastProjectRelativeDataToRenderSpace(NumberVector data)
Project a data vector from data space to rendering space.double[]
fastProjectRelativeScaledToRenderSpace(double[] vr)
Project a vector from scaled space to rendering space.double[]
fastProjectRenderToDataSpace(double x, double y)
Project a data vector from rendering space to data space.double[]
fastProjectRenderToScaledSpace(double x, double y)
Project a vector from rendering space to scaled space.double[]
fastProjectScaledToRenderSpace(double[] v)
Project a vector from scaled space to rendering space.java.lang.String
getMenuName()
Name to display in the menu.long[]
getVisibleDimensions2D()
Get a bit set of dimensions that are visible.protected double[]
rearrange(double[] v)
Method to rearrange components.-
Methods inherited from class elki.visualization.projections.AbstractSimpleProjection
flipSecondEquals, projectRelativeRenderToScaled, projectRelativeScaledToRender, projectRenderToScaled, projectScaledToRender
-
Methods inherited from class elki.visualization.projections.AbstractFullProjection
projectDataToRenderSpace, projectDataToRenderSpace, projectDataToScaledSpace, projectDataToScaledSpace, projectRelativeDataToRenderSpace, projectRelativeDataToRenderSpace, projectRelativeDataToScaledSpace, projectRelativeDataToScaledSpace, projectRelativeRenderToDataSpace, projectRelativeScaledToDataSpace, projectRenderToDataSpace, projectScaledToDataSpace
-
Methods inherited from class elki.visualization.projections.AbstractProjection
getInputDimensionality, getProjector, getScale
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.visualization.projections.Projection
getInputDimensionality, getProjector, getScale
-
-
-
-
Constructor Detail
-
Simple2D
public Simple2D(Projector p, LinearScale[] scales, int ax1, int ax2)
Constructor with a given database and axes.- Parameters:
p
- Projectorscales
- Scales to useax1
- First axisax2
- Second axis
-
-
Method Detail
-
fastProjectDataToRenderSpace
public double[] fastProjectDataToRenderSpace(double[] data)
Description copied from interface:Projection2D
Project a data vector from data space to rendering space.- Specified by:
fastProjectDataToRenderSpace
in interfaceProjection2D
- Parameters:
data
- vector in data space- Returns:
- vector in rendering space
-
fastProjectDataToRenderSpace
public double[] fastProjectDataToRenderSpace(NumberVector data)
Description copied from interface:Projection2D
Project a data vector from data space to rendering space.- Specified by:
fastProjectDataToRenderSpace
in interfaceProjection2D
- Parameters:
data
- vector in data space- Returns:
- vector in rendering space
-
fastProjectDataToScaledSpace
public double[] fastProjectDataToScaledSpace(double[] data)
Description copied from interface:Projection2D
Project a data vector from data space to scaled space.- Specified by:
fastProjectDataToScaledSpace
in interfaceProjection2D
- Parameters:
data
- vector in data space- Returns:
- vector in scaled space
-
fastProjectDataToScaledSpace
public double[] fastProjectDataToScaledSpace(NumberVector data)
Description copied from interface:Projection2D
Project a data vector from data space to scaled space.- Specified by:
fastProjectDataToScaledSpace
in interfaceProjection2D
- Parameters:
data
- vector in data space- Returns:
- vector in scaled space
-
fastProjectScaledToRenderSpace
public double[] fastProjectScaledToRenderSpace(double[] v)
Description copied from interface:Projection2D
Project a vector from scaled space to rendering space.- Specified by:
fastProjectScaledToRenderSpace
in interfaceProjection2D
- Parameters:
v
- vector in scaled space- Returns:
- vector in rendering space
-
fastProjectRenderToDataSpace
public double[] fastProjectRenderToDataSpace(double x, double y)
Description copied from interface:Projection2D
Project a data vector from rendering space to data space.- Specified by:
fastProjectRenderToDataSpace
in interfaceProjection2D
- Parameters:
x
- X coordinatey
- Y coordinate- Returns:
- vector in data space
-
fastProjectRenderToScaledSpace
public double[] fastProjectRenderToScaledSpace(double x, double y)
Description copied from interface:Projection2D
Project a vector from rendering space to scaled space.- Specified by:
fastProjectRenderToScaledSpace
in interfaceProjection2D
- Parameters:
x
- X coordinatey
- Y coordinate- Returns:
- vector in scaled space
-
fastProjectRelativeDataToRenderSpace
public double[] fastProjectRelativeDataToRenderSpace(double[] data)
Description copied from interface:Projection2D
Project a data vector from data space to rendering space.- Specified by:
fastProjectRelativeDataToRenderSpace
in interfaceProjection2D
- Parameters:
data
- vector in data space- Returns:
- vector in rendering space
-
fastProjectRelativeDataToRenderSpace
public double[] fastProjectRelativeDataToRenderSpace(NumberVector data)
Description copied from interface:Projection2D
Project a data vector from data space to rendering space.- Specified by:
fastProjectRelativeDataToRenderSpace
in interfaceProjection2D
- Parameters:
data
- vector in data space- Returns:
- vector in rendering space
-
fastProjectRelativeScaledToRenderSpace
public double[] fastProjectRelativeScaledToRenderSpace(double[] vr)
Description copied from interface:Projection2D
Project a vector from scaled space to rendering space.- Specified by:
fastProjectRelativeScaledToRenderSpace
in interfaceProjection2D
- Parameters:
vr
- vector in scaled space- Returns:
- vector in rendering space
-
getVisibleDimensions2D
public long[] getVisibleDimensions2D()
Description copied from interface:Projection2D
Get a bit set of dimensions that are visible.- Specified by:
getVisibleDimensions2D
in interfaceProjection2D
- Returns:
- Bit set, first dimension is bit 0.
-
estimateViewport
public CanvasSize estimateViewport()
Description copied from interface:Projection2D
Estimate the viewport requirements- Specified by:
estimateViewport
in interfaceProjection2D
- Returns:
- Canvas size obtained from projecting scale endpoints
-
rearrange
protected double[] rearrange(double[] v)
Description copied from class:AbstractSimpleProjection
Method to rearrange components.- Specified by:
rearrange
in classAbstractSimpleProjection
- Parameters:
v
- double[] to rearrange- Returns:
- rearranged copy
-
dearrange
protected double[] dearrange(double[] v)
Description copied from class:AbstractSimpleProjection
Undo the rearrangement of components.- Specified by:
dearrange
in classAbstractSimpleProjection
- Parameters:
v
- double[] to undo the rearrangement- Returns:
- rearranged-undone copy
-
getMenuName
public java.lang.String getMenuName()
Description copied from interface:VisualizationItem
Name to display in the menu. May benull
or empty string.- Specified by:
getMenuName
in interfaceVisualizationItem
- Overrides:
getMenuName
in classAbstractProjection
- Returns:
- Menu name.
-
-