Fixed Bug Where EIC Was Not Displayed After Alignment and Improved Chart UI#550
Merged
Fixed Bug Where EIC Was Not Displayed After Alignment and Improved Chart UI#550
Conversation
Replaced MultiChart with SimpleChartControl in Ms2ChromatogramsView.xaml, simplifying the charting component. Removed MultiChart-specific properties, styles, and templates. Configured SimpleChartControl with bindings for titles and axes, applying a new BasicChart style. Retained and moved the chart's ContextMenu for saving/copying chromatograms. Introduced a Grid layout and multiple ItemsControl elements for rendering chromatograms and legends. Updated tooltips for consistent formatting. Improved modularity, readability, and maintainability by adopting a simpler and more flexible charting approach.
Replaced dynamic brush creation with a precomputed `cls2brsh` dictionary mapping class names to observable brushes, improving efficiency and simplifying logic. Updated `files.Zip(peaks, brushes)` to use `files.ZipInternal(peaks)` for better alignment with code requirements. Adjusted fallback brush logic to use `ChartBrushes.GetChartBrush` for missing class names. These changes enhance readability and reduce redundant brush creation.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where the EIC was not displayed after alignment and improves the chart UI by refactoring brush mapping logic and simplifying row generation.
- Revised brush mapping using a new observable approach with Replay(1).RefCount()
- Updated row generation with a new ZipInternal method
- Standardized tooltips on chart controls
Files not reviewed (1)
- src/MSDIAL5/MsdialGuiApp/View/Chart/Ms2ChromatogramsView.xaml: Language not supported
Comments suppressed due to low confidence (1)
src/MSDIAL5/MsdialGuiApp/View/PeakCuration/SampleTableViewerInAlignmentLegacy.xaml.cs:200
- [nitpick] The variable name 'cls2brsh' is abbreviated and may be unclear to future maintainers. Consider renaming it to 'classBrushMap' for improved clarity.
var cls2brsh = filePropertiesModel.ClassProperties.ToDictionary(
Bujee415
approved these changes
Apr 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Classification
Code cleanup and UI improvement
PR Summary
Refactored chart controls and brush mapping logic to improve maintainability, performance, and UI flexibility.
MultiChartwithSimpleChartControl, updated bindings, styles, and addedItemsControltemplates for chromatograms.cls2brshwithReplay(1).RefCount()and refactored row generation withZipInternal.LineChartControlandScatterControlSlimto a consistent format.