Class CircleSegmentsVisualizer.Instance
- java.lang.Object
-
- elki.visualization.visualizers.AbstractVisualization
-
- elki.visualization.visualizers.pairsegments.CircleSegmentsVisualizer.Instance
-
- All Implemented Interfaces:
DataStoreListener,ResultListener,VisualizationListener,Visualization,java.util.EventListener
- Enclosing class:
- CircleSegmentsVisualizer
public static class CircleSegmentsVisualizer.Instance extends AbstractVisualization implements ResultListener
Instance- Author:
- Sascha Goldhofer, Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classCircleSegmentsVisualizer.Instance.SegmentListenerProxyProxy element to connect signals.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCLR_BORDER_CLASSCSS border class of a clusterprivate static java.lang.StringCLR_CLUSTER_CLASS_PREFIXCSS class name for the clusterings.static java.lang.StringCLR_HOVER_CLASSCSS hover class of a segment clusterstatic java.lang.StringCLR_UNPAIRED_CLASSCSS hover class for clusters of hovered segmentprivate org.w3c.dom.ElementctrlLayerThe two main layersprivate booleannoIncrementalRedrawFlag to disallow an incremental redrawprotected SegmentsStylingPolicypolicyStyling policyprivate static doubleRADIUS_DISTANCEMargin between two ringsprivate static doubleRADIUS_INNEROffset from center to first ringprivate static doubleRADIUS_OUTERRadius of whole CircleSegments except selection borderprivate static doubleRADIUS_SELECTIONRadius of highlight selection (outer ring)static java.lang.StringSEG_UNPAIRED_SELECTED_CLASSCSS class of selected Segmentprivate static doubleSEGMENT_MIN_ANGLEMinimum width (radian) of Segmentprivate static doubleSEGMENT_MIN_SEP_ANGLEGap (radian) between segmentsprotected SegmentssegmentsSegmentation of Clusteringsjava.util.Map<Segment,java.util.List<org.w3c.dom.Element>>segmentToElementsMap to connect segments to their visual elements(package private) booleanshowUnclusteredPairsShow unclustered Pairs in CircleSegmentsstatic java.lang.StringSTYLEStyle prefixstatic java.lang.StringSTYLE_BORDERStyle for border linesstatic java.lang.StringSTYLE_GRADIENT_FIRSTFirst color for producing segment-cluster colorsstatic java.lang.StringSTYLE_GRADIENT_SECONDSecond color for producing segment-cluster colorsstatic java.lang.StringSTYLE_HOVERStyle for hover effectprivate org.w3c.dom.ElementvisLayerThe two main layers-
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)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCSSClasses(int maxClusterSize)Define and add required CSS classesprotected org.w3c.dom.ElementdrawClusteringInfo()private voiddrawSegments()Create the segmentsvoidfullRedraw()Request a full redrawing of the visualization.voidincrementalRedraw()Redraw the visualization (maybe incremental).protected java.lang.String[]makeGradient(int shades, java.lang.String[] colors)Creates a gradient over a set of colorsprivate voidredrawSelection()voidresultChanged(java.lang.Object current)Notify that the current result has changed substantially.protected voidsegmentClick(Segment segment, org.w3c.dom.events.Event evt, boolean dblClick)protected voidsegmentHover(Segment segment, int ringid, boolean active)voidtoggleUnclusteredPairs(boolean show)-
Methods inherited from class elki.visualization.visualizers.AbstractVisualization
addListeners, contentChanged, destroy, getHeight, getLayer, getWidth, visualizationChanged
-
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
-
SEGMENT_MIN_ANGLE
private static final double SEGMENT_MIN_ANGLE
Minimum width (radian) of Segment- See Also:
- Constant Field Values
-
SEGMENT_MIN_SEP_ANGLE
private static final double SEGMENT_MIN_SEP_ANGLE
Gap (radian) between segments- See Also:
- Constant Field Values
-
RADIUS_INNER
private static final double RADIUS_INNER
Offset from center to first ring- See Also:
- Constant Field Values
-
RADIUS_DISTANCE
private static final double RADIUS_DISTANCE
Margin between two rings- See Also:
- Constant Field Values
-
RADIUS_OUTER
private static final double RADIUS_OUTER
Radius of whole CircleSegments except selection border- See Also:
- Constant Field Values
-
RADIUS_SELECTION
private static final double RADIUS_SELECTION
Radius of highlight selection (outer ring)- See Also:
- Constant Field Values
-
CLR_CLUSTER_CLASS_PREFIX
private static final java.lang.String CLR_CLUSTER_CLASS_PREFIX
CSS class name for the clusterings.- See Also:
- Constant Field Values
-
CLR_BORDER_CLASS
public static final java.lang.String CLR_BORDER_CLASS
CSS border class of a cluster- See Also:
- Constant Field Values
-
CLR_UNPAIRED_CLASS
public static final java.lang.String CLR_UNPAIRED_CLASS
CSS hover class for clusters of hovered segment- See Also:
- Constant Field Values
-
CLR_HOVER_CLASS
public static final java.lang.String CLR_HOVER_CLASS
CSS hover class of a segment cluster- See Also:
- Constant Field Values
-
SEG_UNPAIRED_SELECTED_CLASS
public static final java.lang.String SEG_UNPAIRED_SELECTED_CLASS
CSS class of selected Segment- See Also:
- Constant Field Values
-
STYLE
public static final java.lang.String STYLE
Style prefix- See Also:
- Constant Field Values
-
STYLE_BORDER
public static final java.lang.String STYLE_BORDER
Style for border lines- See Also:
- Constant Field Values
-
STYLE_HOVER
public static final java.lang.String STYLE_HOVER
Style for hover effect- See Also:
- Constant Field Values
-
STYLE_GRADIENT_FIRST
public static final java.lang.String STYLE_GRADIENT_FIRST
First color for producing segment-cluster colors- See Also:
- Constant Field Values
-
STYLE_GRADIENT_SECOND
public static final java.lang.String STYLE_GRADIENT_SECOND
Second color for producing segment-cluster colors- See Also:
- Constant Field Values
-
segments
protected final Segments segments
Segmentation of Clusterings
-
visLayer
private org.w3c.dom.Element visLayer
The two main layers
-
ctrlLayer
private org.w3c.dom.Element ctrlLayer
The two main layers
-
segmentToElements
public java.util.Map<Segment,java.util.List<org.w3c.dom.Element>> segmentToElements
Map to connect segments to their visual elements
-
showUnclusteredPairs
boolean showUnclusteredPairs
Show unclustered Pairs in CircleSegments
-
policy
protected final SegmentsStylingPolicy policy
Styling policy
-
noIncrementalRedraw
private boolean noIncrementalRedraw
Flag to disallow an incremental redraw
-
-
Constructor Detail
-
Instance
public Instance(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height)
Constructor- Parameters:
context- Visualizer contexttask- Taskplot- Plot to draw towidth- Embedding widthheight- Embedding height
-
-
Method Detail
-
toggleUnclusteredPairs
public void toggleUnclusteredPairs(boolean show)
-
resultChanged
public void resultChanged(java.lang.Object current)
Description copied from interface:ResultListenerNotify that the current result has changed substantially.- Specified by:
resultChangedin interfaceResultListener- Overrides:
resultChangedin classAbstractVisualization- Parameters:
current- Result that has changed.
-
incrementalRedraw
public void incrementalRedraw()
Description copied from class:AbstractVisualizationRedraw the visualization (maybe incremental). Optional - by default, it will do a full redraw, which often is faster!- Specified by:
incrementalRedrawin interfaceVisualization- Overrides:
incrementalRedrawin classAbstractVisualization
-
fullRedraw
public void fullRedraw()
Description copied from interface:VisualizationRequest a full redrawing of the visualization.- Specified by:
fullRedrawin interfaceVisualization- Specified by:
fullRedrawin classAbstractVisualization
-
addCSSClasses
protected void addCSSClasses(int maxClusterSize)
Define and add required CSS classes
-
drawSegments
private void drawSegments()
Create the segments
-
redrawSelection
private void redrawSelection()
-
makeGradient
protected java.lang.String[] makeGradient(int shades, java.lang.String[] colors)Creates a gradient over a set of colors- Parameters:
shades- number of colors in the gradientcolors- colors for the gradient- Returns:
- array of colors for CSS
-
drawClusteringInfo
protected org.w3c.dom.Element drawClusteringInfo()
-
segmentHover
protected void segmentHover(Segment segment, int ringid, boolean active)
-
segmentClick
protected void segmentClick(Segment segment, org.w3c.dom.events.Event evt, boolean dblClick)
-
-