-
Notifications
You must be signed in to change notification settings - Fork 402
* Refactoring and simplification of heatmap legend editing and usage #1799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jrobinso
commented
Dec 31, 2025
- Add dark mode heatmaps for copy number and gene expression.
* Add dark mode heatmaps for copy number and gene expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors heatmap legend editing and usage, simplifying the codebase by consolidating color scale management and adding dark mode support for heatmaps.
- Introduces dark mode color scales for copy number and gene expression heatmaps
- Refactors color scale management to use string-based keys instead of TrackType enums
- Simplifies heatmap legend editor by removing unused TrackType parameter
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| test/sessions/wig_heatmap.xml | New test session for heatmap rendering with ChipSeq data |
| test/sessions/gbm_subtypes2.xml | New test session for copy number heatmaps |
| test/sessions/gbm_subtypes.xml | Updates resource URLs to use GitHub raw content |
| src/main/resources/preferences.tab | Adds dark mode color scale preferences for copy number and gene expression |
| src/main/java/org/igv/ui/legend/HeatmapLegendEditor.java | Removes TrackType parameter from constructor |
| src/main/java/org/igv/ui/HeatmapScaleDialog.java | Removes unused main method |
| src/main/java/org/igv/track/TrackMenuUtils.java | Refactors heatmap scale dialog to use lambda and adds null safety for color scales |
| src/main/java/org/igv/track/MergedTracks.java | Removes redundant getColorScale override |
| src/main/java/org/igv/track/FeatureTrack.java | Removes manual color scale range adjustment |
| src/main/java/org/igv/track/AbstractTrack.java | Refactors getColorScale to check preferences by key and simplifies logic |
| src/main/java/org/igv/session/Session.java | Simplifies getColorScale to not fall back to preferences |
| src/main/java/org/igv/session/IGVSessionReader.java | Cleans up comments in color scale parsing |
| src/main/java/org/igv/prefs/PreferencesEditor.java | Refactors to use LegendPanel and improves combo box handling with SelectionItem wrapper |
| src/main/java/org/igv/prefs/LegendPanel.java | Renamed from HeatmapLegendPanel, refactored to use string keys and adds dark mode support for labels |
| src/main/java/org/igv/prefs/IGVPreferences.java | Refactors color scale management to use string keys, adds getColorScale(String) overload, renames get() to getUserPreference() |
| src/main/java/org/igv/maf/MultipleAlignmentTrack.java | Removes empty setColorScale override |
Comments suppressed due to low confidence (3)
src/main/java/org/igv/prefs/LegendPanel.java:7
- The import for TrackType is unused. After the refactoring, this class no longer uses TrackType anywhere in its implementation. Consider removing this unused import.
src/main/java/org/igv/prefs/LegendPanel.java:52 - The mouseExited() method is empty. Consider resetting the cursor to the default when the mouse exits the component to properly restore the cursor state.
src/main/java/org/igv/prefs/LegendPanel.java:139 - The label color is set to use dark mode detection (Globals.isDarkMode() ? Color.WHITE : Color.BLACK) in paintHorizontal(). However, the vertical painting method paintVertical() still uses hardcoded Color.BLACK at line 182. For consistency with the dark mode support added in this PR, paintVertical() should also use the same dark mode-aware color selection.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Ignore | ||
| } | ||
| } | ||
| colorScaleCache.put(key, scale); |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method caches null values in colorScaleCache (line 763) when both the preference lookup and TrackType parsing fail. This could prevent subsequent attempts to retrieve a valid color scale. Consider only caching non-null values or returning early when the scale cannot be determined.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>