Skip to content

Fixed Bug Where EIC Was Not Displayed After Alignment and Improved Chart UI#550

Merged
Bujee415 merged 2 commits intomasterfrom
bugfix/chart-loading-bug
Apr 28, 2025
Merged

Fixed Bug Where EIC Was Not Displayed After Alignment and Improved Chart UI#550
Bujee415 merged 2 commits intomasterfrom
bugfix/chart-loading-bug

Conversation

@YukiMatsuzawa
Copy link
Copy Markdown
Contributor

PR Classification

Code cleanup and UI improvement

PR Summary

Refactored chart controls and brush mapping logic to improve maintainability, performance, and UI flexibility.

  • Ms2ChromatogramsView.xaml: Replaced MultiChart with SimpleChartControl, updated bindings, styles, and added ItemsControl templates for chromatograms.
  • SampleTableViewerInAlignmentLegacy.xaml.cs: Simplified brush mapping using cls2brsh with Replay(1).RefCount() and refactored row generation with ZipInternal.
  • Standardized tooltips for LineChartControl and ScatterControlSlim to a consistent format.

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.
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 Bujee415 merged commit 82e61ea into master Apr 28, 2025
9 checks passed
@Bujee415 Bujee415 deleted the bugfix/chart-loading-bug branch April 28, 2025 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants