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 class
CircleSegmentsVisualizer.Instance.SegmentListenerProxy
Proxy element to connect signals.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLR_BORDER_CLASS
CSS border class of a clusterprivate static java.lang.String
CLR_CLUSTER_CLASS_PREFIX
CSS class name for the clusterings.static java.lang.String
CLR_HOVER_CLASS
CSS hover class of a segment clusterstatic java.lang.String
CLR_UNPAIRED_CLASS
CSS hover class for clusters of hovered segmentprivate org.w3c.dom.Element
ctrlLayer
The two main layersprivate boolean
noIncrementalRedraw
Flag to disallow an incremental redrawprotected SegmentsStylingPolicy
policy
Styling policyprivate static double
RADIUS_DISTANCE
Margin between two ringsprivate static double
RADIUS_INNER
Offset from center to first ringprivate static double
RADIUS_OUTER
Radius of whole CircleSegments except selection borderprivate static double
RADIUS_SELECTION
Radius of highlight selection (outer ring)static java.lang.String
SEG_UNPAIRED_SELECTED_CLASS
CSS class of selected Segmentprivate static double
SEGMENT_MIN_ANGLE
Minimum width (radian) of Segmentprivate static double
SEGMENT_MIN_SEP_ANGLE
Gap (radian) between segmentsprotected Segments
segments
Segmentation of Clusteringsjava.util.Map<Segment,java.util.List<org.w3c.dom.Element>>
segmentToElements
Map to connect segments to their visual elements(package private) boolean
showUnclusteredPairs
Show unclustered Pairs in CircleSegmentsstatic java.lang.String
STYLE
Style prefixstatic java.lang.String
STYLE_BORDER
Style for border linesstatic java.lang.String
STYLE_GRADIENT_FIRST
First color for producing segment-cluster colorsstatic java.lang.String
STYLE_GRADIENT_SECOND
Second color for producing segment-cluster colorsstatic java.lang.String
STYLE_HOVER
Style for hover effectprivate org.w3c.dom.Element
visLayer
The 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 void
addCSSClasses(int maxClusterSize)
Define and add required CSS classesprotected org.w3c.dom.Element
drawClusteringInfo()
private void
drawSegments()
Create the segmentsvoid
fullRedraw()
Request a full redrawing of the visualization.void
incrementalRedraw()
Redraw the visualization (maybe incremental).protected java.lang.String[]
makeGradient(int shades, java.lang.String[] colors)
Creates a gradient over a set of colorsprivate void
redrawSelection()
void
resultChanged(java.lang.Object current)
Notify that the current result has changed substantially.protected void
segmentClick(Segment segment, org.w3c.dom.events.Event evt, boolean dblClick)
protected void
segmentHover(Segment segment, int ringid, boolean active)
void
toggleUnclusteredPairs(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:ResultListener
Notify that the current result has changed substantially.- Specified by:
resultChanged
in interfaceResultListener
- Overrides:
resultChanged
in classAbstractVisualization
- Parameters:
current
- Result that has changed.
-
incrementalRedraw
public void incrementalRedraw()
Description copied from class:AbstractVisualization
Redraw the visualization (maybe incremental). Optional - by default, it will do a full redraw, which often is faster!- Specified by:
incrementalRedraw
in interfaceVisualization
- Overrides:
incrementalRedraw
in classAbstractVisualization
-
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
-
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)
-
-