Class KeyVisualization
- java.lang.Object
-
- elki.visualization.visualizers.visunproj.KeyVisualization
-
- All Implemented Interfaces:
VisualizationProcessor,VisFactory
public class KeyVisualization extends java.lang.Object implements VisFactory
Visualizer, displaying the key for a clustering.TODO: re-add automatic sizing depending on the number of clusters.
TODO: also show in scatter plot detail view.
- Since:
- 0.3
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKeyVisualization.InstanceInstance
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringNAMEName for this visualizer.
-
Constructor Summary
Constructors Constructor Description KeyVisualization()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowThumbnails(VisualizationTask task)Test whether to do a thumbnail or a full rendering.protected static <M extends Model>
int[]findDepth(Clustering<M> c)Compute the size of the clustering.private static <M extends Model>
voidfindDepth(Hierarchy<Cluster<M>> hier, Cluster<M> cluster, int[] size)Recursive depth computation.protected static intgetPreferredColumns(double width, double height, int numc, double maxwidth)Compute the preferred number of columns.VisualizationmakeVisualization(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)Produce a visualization instance for the given taskvoidprocessNewResult(VisualizerContext context, java.lang.Object start)Add visualizers for the given result (tree) to the context.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.visualization.visualizers.VisFactory
makeVisualizationOrThumbnail
-
-
-
-
Field Detail
-
NAME
private static final java.lang.String NAME
Name for this visualizer.- See Also:
- Constant Field Values
-
-
Method Detail
-
processNewResult
public void processNewResult(VisualizerContext context, java.lang.Object start)
Description copied from interface:VisFactoryAdd visualizers for the given result (tree) to the context.- Specified by:
processNewResultin interfaceVisFactory- Specified by:
processNewResultin interfaceVisualizationProcessor- Parameters:
context- Visualization contextstart- Result to process
-
findDepth
protected static <M extends Model> int[] findDepth(Clustering<M> c)
Compute the size of the clustering.- Parameters:
c- Clustering- Returns:
- Array storing the depth and the number of leaf nodes.
-
findDepth
private static <M extends Model> void findDepth(Hierarchy<Cluster<M>> hier, Cluster<M> cluster, int[] size)
Recursive depth computation.- Parameters:
hier- Hierarchycluster- Current clustersize- Counting array.
-
getPreferredColumns
protected static int getPreferredColumns(double width, double height, int numc, double maxwidth)Compute the preferred number of columns.- Parameters:
width- Target widthheight- Target heightnumc- Number of clustersmaxwidth- Max width of entries- Returns:
- Preferred number of columns
-
makeVisualization
public Visualization makeVisualization(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)
Description copied from interface:VisFactoryProduce a visualization instance for the given task- Specified by:
makeVisualizationin interfaceVisFactory- Parameters:
context- Visualization contexttask- Visualization taskplot- Plotwidth- Widthheight- Heightproj- Projection- Returns:
- Visualization
-
allowThumbnails
public boolean allowThumbnails(VisualizationTask task)
Description copied from interface:VisFactoryTest whether to do a thumbnail or a full rendering. Override this with "false" to disable thumbnails!- Specified by:
allowThumbnailsin interfaceVisFactory- Parameters:
task- Task requested
-
-