Add clusteringPixelSizeThreshold option #222
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, Progress Tracking, and Performance Improvements
Summary
This PR introduces several enhancements to annotation clustering and processing:
undefinedChanges
1. Clustering Pixel Size Threshold (Initial Feature)
Added
clusteringPixelSizeThresholdto annotation optionsundefinedwhich falls back to zoom-based detectionEnhanced
isHighResolutionfunction inaddAnnotationGroupsAdded
setAnnotationOptionsmethod2. Progress Tracking Infrastructure
Added progress events
ANNOTATION_PROCESSING_PROGRESS- Tracks annotation processing progressANNOTATION_RETRIEVAL_PROGRESS- Tracks annotation retrieval progressEnhanced annotation processing
annotationGroupUID,processed,total,percentageAdded utility modules
annotationProcessingQueue.js- Queue management for annotation processing tasksasyncProcessor.js- Chunked processing utilities with progress trackingperformanceMonitor.js- Performance monitoring utilitiesWeb worker enhancements
annotationCoordinateTransformTask.js- Coordinate transformation in web workersannotationStatisticsTask.js- Statistics computation in web workers3. Support for Disabling Clustering (Latest Feature)
Enhanced
setAnnotationOptionsmethodclusteringPixelSizeThresholdisundefined, always shows high-resolution layer_annotationOptionsobjectFixed
isHighResolutionfunction inaddAnnotationGroupsclusteringPixelSizeThresholdisundefined, returnstrue(always use high-res layer)undefinedwhich caused incorrect layer selectionOptimized layer visibility management
moveendhandler applies correct layer when group becomes visible4. Dependency Updates
5. Code Quality
/** */formatBehavior Changes
When Clustering is Disabled (
clusteringPixelSizeThreshold === undefined)When Clustering is Enabled
Performance Improvements
Code Quality
/** */)Testing
Clustering pixel size threshold can be configured and updated
Clustering can be disabled by setting threshold to
undefinedHigh-resolution layer is always used when clustering is disabled
Progress events are emitted during annotation operations
No unnecessary annotation loading when toggling clustering
Works correctly when clustering is disabled before annotations are loaded
Layer switching works correctly when annotations become visible
Bulk annotations always cluster slim#330 (comment)