Skip to content

Added Support for Multiple Intensity Axis Titles in MS/MS Spectrum View#551

Merged
Bujee415 merged 7 commits intomasterfrom
improve/spectra-graph-axis-type
Apr 28, 2025
Merged

Added Support for Multiple Intensity Axis Titles in MS/MS Spectrum View#551
Bujee415 merged 7 commits intomasterfrom
improve/spectra-graph-axis-type

Conversation

@YukiMatsuzawa
Copy link
Copy Markdown
Contributor

PR Classification

New feature, code cleanup, and null safety improvements.

PR Summary

This PR introduces support for multiple axis titles, enhances null safety, and refactors axis-related logic for better performance and usability.

  • AxisTitles.cs: Added AxisTitles class and AxisTitlesTypeConverter to support multiple axis titles.
  • MsSpectrumModel.cs: Introduced VerticalTitles property, marked VerticalTitle as obsolete, and improved nullability handling.
  • XAML Updates: Updated bindings and replaced vertical title implementation with ItemsControl for multiple titles.
  • Null Safety Enhancements: Added null checks and null-conditional operators across multiple files to prevent null reference exceptions.
  • General Refactoring: Improved axis item handling in SingleSpectrumViewModel and refactored peak detection logic in spectrum models.

- Added a transparent rectangle to the chart area to ensure
  interactivity and visual consistency.
- Increased the `radius` constant from 3d to 4d, likely affecting
  visual element size or sensitivity.
- Refactored `FocusedItem` and `FocusedPoint` logic for better
  clarity and proper null handling.
Introduce the AxisTitles class in the CompMs.Graphics.Base namespace,
providing a bindable representation of axis titles with change
notification support. Add the AxisTitlesTypeConverter class to enable
custom type conversion for AxisTitles, supporting conversions from
string and IEnumerable<string> to AxisTitles, and vice versa. Include
necessary using directives for required namespaces.
Updated the CompareTo, Equals, ToString, GetHashCode, and
IsNaN methods in the AxisValue class to be readonly. This
ensures these methods do not modify the object's state,
reinforcing immutability and improving code clarity.
Enhanced `MultiChart` and `SimpleChartControl` with new private
boolean fields to manage state during property changes and prevent
recursive updates. Updated `HorizontalTitle` and `VerticalTitle`
dependency properties with change callbacks for synchronization.

Introduced `HorizontalTitles` and `VerticalTitles` dependency
properties to support `AxisTitles` objects for complex title
management. Implemented bidirectional synchronization between
single and multiple title properties. Updated constructors to
initialize `RenderAreaControlStateProperty` with a new instance.
Updated `AxisItemModel` properties to be nullable, added null-checks
and fallback values to prevent runtime errors, and enhanced
`AxisItemSelector` with new methods. Introduced `VerticalTitles`
property, marking `VerticalTitle` as obsolete. Improved error
handling, reactive property updates, and code consistency. Updated
view models and methods to align with these changes.
Updated MsSpectrumView.xaml and ChartStyles.xaml to enable
dynamic support for multiple vertical axis titles using an
ItemsControl with a UniformGrid layout. Adjusted bindings
in RawPurifiedView.xaml to reflect the new multi-title
structure and improved axis title styling.
Introduce a new "Absolute" axis type in ObservableMsSpectrum.cs,
created using ToReactiveContinuousAxisManager with a ConstantMargin
of (0, 30) and initial values of 0d for min/max. Add it to
AxisItemSelector as an AxisItemModel with a label and description.
Ensure proper disposal by adding to the Disposables collection.
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Bujee415 Bujee415 merged commit af99ec2 into master Apr 28, 2025
9 checks passed
@Bujee415 Bujee415 deleted the improve/spectra-graph-axis-type branch April 28, 2025 08:31
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