Add clusteringPixelSizeThreshold #363
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Clustering Configuration and Progress Indicators
Summary
This PR introduces several enhancements to annotation clustering and processing:
Changes
1. Clustering Pixel Size Threshold (Initial Feature)
Added
clusteringPixelSizeThresholdto component statenumber0.001mm (1 micrometer)SlideViewerStateinterfaceAdded threshold input UI
Updated viewer construction
clusteringPixelSizeThresholdto viewer viaannotationOptionsconstructViewersutility functionAdded
handleClusteringPixelSizeThresholdChangehandler2. Progress Indicator for Bulk Annotations
Added
AnnotationProgresscomponentANNOTATION_PROCESSING_PROGRESSandANNOTATION_RETRIEVAL_PROGRESSeventsIntegrated progress component in SlideViewer
3. UI Toggle for Clustering (Latest Feature)
Added clustering toggle switch in the Annotation Groups menu
SwitchcomponentisClusteringEnabled: true)Conditional display of threshold input
State Management
isClusteringEnabledto component state (type:boolean, default:true)shouldComponentUpdateto include clustering state changesViewer Integration
clusteringPixelSizeThresholdis passed asundefinedto the viewerhandleClusteringTogglehandler with error handling4. Style Updates
Code Quality
/** */)User Experience
Testing
Threshold can be set and updated successfully
Toggle can be switched on/off successfully
Threshold input appears/disappears based on toggle state
Viewer correctly applies clustering settings when toggled
Progress indicator displays during annotation operations
No unnecessary annotation loading when toggling clustering
Works correctly when toggled before annotations are loaded
Bulk annotations always cluster #330 (comment)
DMV PR: Add clusteringPixelSizeThreshold option dicom-microscopy-viewer#222