Package elki.visualization.style
Class ClusterStylingPolicy
- java.lang.Object
-
- elki.visualization.style.ClusterStylingPolicy
-
- All Implemented Interfaces:
ClassStylingPolicy
,StylingPolicy
,VisualizationItem
public class ClusterStylingPolicy extends java.lang.Object implements ClassStylingPolicy
Styling policy based on cluster membership.TODO: allow cycling though the different intensity transformations.
- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClusterStylingPolicy.IntensityTransform
Intensity transformation functions
-
Field Summary
Fields Modifier and Type Field Description (package private) Clustering<?>
clustering
Clustering in use.(package private) it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Cluster<?>>
cmap
Map from cluster objects to color offsets.(package private) it.unimi.dsi.fastutil.ints.IntArrayList
colors
Colors(package private) java.util.ArrayList<DBIDs>
ids
Object IDs.(package private) WritableDoubleDataStore
intensities
Maps an ID to its best assignment value.(package private) ClusterStylingPolicy.IntensityTransform
inttrans
Intensity transformation(package private) double
maxint
Intensity scaling(package private) double
minint
Intensity scaling
-
Constructor Summary
Constructors Constructor Description ClusterStylingPolicy(Clustering<?> clustering, StyleLibrary style)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
classSize(int cnum)
Get the number of elements in the styling class.Clustering<?>
getClustering()
Get the clustering used by this styling policyint
getColorForDBID(DBIDRef id)
Get the color for an individual object.double
getIntensityForDBID(DBIDRef id)
Get the Intensity for an individual object.int
getMaxStyle()
Get the maximum style in use.java.lang.String
getMenuName()
Name to display in the menu.int
getMinStyle()
Get the minimum style in use.int
getStyleForCluster(Cluster<?> c)
Get the style number for a cluster.int
getStyleForDBID(DBIDRef id)
Get the style number for a particular objectDBIDIter
iterateClass(int cnum)
Iterate over all objects from a given class.
-
-
-
Field Detail
-
inttrans
ClusterStylingPolicy.IntensityTransform inttrans
Intensity transformation
-
ids
java.util.ArrayList<DBIDs> ids
Object IDs.
-
cmap
it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<Cluster<?>> cmap
Map from cluster objects to color offsets.
-
colors
it.unimi.dsi.fastutil.ints.IntArrayList colors
Colors
-
clustering
Clustering<?> clustering
Clustering in use.
-
intensities
WritableDoubleDataStore intensities
Maps an ID to its best assignment value.
-
minint
double minint
Intensity scaling
-
maxint
double maxint
Intensity scaling
-
-
Constructor Detail
-
ClusterStylingPolicy
public ClusterStylingPolicy(Clustering<?> clustering, StyleLibrary style)
Constructor.- Parameters:
clustering
- Clustering to use.
-
-
Method Detail
-
getStyleForDBID
public int getStyleForDBID(DBIDRef id)
Description copied from interface:ClassStylingPolicy
Get the style number for a particular object- Specified by:
getStyleForDBID
in interfaceClassStylingPolicy
- Parameters:
id
- Object ID- Returns:
- Style number
-
getColorForDBID
public int getColorForDBID(DBIDRef id)
Description copied from interface:StylingPolicy
Get the color for an individual object.Note: if possible, use a class styling policy which can optimize better.
- Specified by:
getColorForDBID
in interfaceStylingPolicy
- Parameters:
id
- Object ID- Returns:
- Color value
-
getIntensityForDBID
public double getIntensityForDBID(DBIDRef id)
Description copied from interface:StylingPolicy
Get the Intensity for an individual object.Note: if possible, use a class styling policy which can optimize better.
- Specified by:
getIntensityForDBID
in interfaceStylingPolicy
- Parameters:
id
- Object ID- Returns:
- Intensity value
-
getMinStyle
public int getMinStyle()
Description copied from interface:ClassStylingPolicy
Get the minimum style in use.- Specified by:
getMinStyle
in interfaceClassStylingPolicy
- Returns:
- Style number
-
getMaxStyle
public int getMaxStyle()
Description copied from interface:ClassStylingPolicy
Get the maximum style in use.- Specified by:
getMaxStyle
in interfaceClassStylingPolicy
- Returns:
- Style number
-
iterateClass
public DBIDIter iterateClass(int cnum)
Description copied from interface:ClassStylingPolicy
Iterate over all objects from a given class.- Specified by:
iterateClass
in interfaceClassStylingPolicy
- Parameters:
cnum
- Class number- Returns:
- Iterator over object IDs
-
classSize
public int classSize(int cnum)
Description copied from interface:ClassStylingPolicy
Get the number of elements in the styling class.- Specified by:
classSize
in interfaceClassStylingPolicy
- Parameters:
cnum
- Class number- Returns:
- Size of class.
-
getClustering
public Clustering<?> getClustering()
Get the clustering used by this styling policy- Returns:
- Clustering in use
-
getStyleForCluster
public int getStyleForCluster(Cluster<?> c)
Get the style number for a cluster.- Parameters:
c
- Cluster- Returns:
- Style number
-
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
- Returns:
- Menu name.
-
-