6.8 KiB
6.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:26:50.843144+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 31b0212fbe1dea4d |
ViewerChartOptions
Documentation: Viewer Chart Options Events
1. Purpose
This module defines a set of Prism PubSubEvent-based events used to communicate state changes and user requests related to chart visualization options in the DTS Viewer component. These events decouple chart UI controls (e.g., zoom, cursor, axis, export) from the underlying view models and chart rendering logic, enabling loose coupling and event-driven updates across the application. All events reside in the DTS.Common.Events namespace and are part of the shared DTS.Common library.
2. Public Interface
| Event Class | Payload Type | Behavior |
|---|---|---|
ResetZoomChangedEvent |
bool |
Published when the reset-zoom option state changes (e.g., enabled/disabled). Note: XML comment incorrectly states “The Data Folder changed event.” |
CursorShowChangedEvent |
bool |
Published when the visibility state of the primary cursor changes. Note: XML comment incorrectly states “The Data Folder changed event.” |
CursorsClearChangedEvent |
bool |
Published when the state of the “clear cursors” option changes. Note: XML comment incorrectly states “The Data Folder changed event.” |
CursorShowMinMaxChangedEvent |
bool |
Published when the option to show min/max values for cursors changes. Note: XML comment incorrectly states “The Data Folder changed event.” |
CursorsAlailableChangedEvent |
bool |
Published when the availability (e.g., enabled/disabled) of cursor functionality changes. Note: Typo in class name (Alailable instead of Available); XML comment incorrectly states “The Data Folder changed event.” |
SaveToPDFRequestedEvent |
string |
Published when the user requests saving the current chart to PDF. The payload is a string—likely a suggested file path or filename. |
ChartAxisChangedEvent |
ChartAxisChangedEventArg |
Published when chart axis ranges are modified. Payload contains the parent view model, axis identifier, and min/max values. |
ChartOptionsChangedEvent |
ChartOptionsChangedEventArg |
Published when general chart options change (e.g., chart type, model settings). Payload contains the parent view model, the updated chart options model, and chart type. |
Helper Types
-
ChartAxisChangedEventArgParentVM:IBaseViewModel– The view model associated with the chart.Axis:string– Identifier for the axis (e.g.,"X","Y","Primary","Secondary").MinValue:double– New minimum value for the axis.MaxValue:double– New maximum value for the axis.
-
ChartOptionsChangedEventArgParentVM:IBaseViewModel– The view model associated with the chart.Model:IChartOptionsModel– The updated chart options model instance.ChartType:string– The chart type (e.g.,"Line","Bar","Scatter").
3. Invariants
- All events inherit from
Prism.Events.PubSubEvent<T>, meaning they use Prism’s event aggregation pattern for thread-safe, decoupled publish/subscribe communication. - Boolean events (
ResetZoomChangedEvent,CursorShowChangedEvent,CursorsClearChangedEvent,CursorShowMinMaxChangedEvent,CursorsAlailableChangedEvent) useboolpayloads to represent state changes (e.g., toggled on/off), not necessarily current values—subscribers must interpret the payload as the new state. SaveToPDFRequestedEvent’sstringpayload is not validated in this file; its semantics (e.g., path vs. filename) are implementation-dependent.ChartAxisChangedEventArgandChartOptionsChangedEventArgboth require aParentVMof typeIBaseViewModel, implying the event originator must be a view model implementing that interface.ChartOptionsChangedEventArg.Modelmust implementIChartOptionsModel, but no validation is enforced at the event level.
4. Dependencies
Dependencies of this module:
Prism.Events– Core dependency forPubSubEvent<T>.DTS.Common.Base– Required forIBaseViewModel(used inChartAxisChangedEventArgandChartOptionsChangedEventArg).DTS.Common.Interface– Required forIChartOptionsModel(used inChartOptionsChangedEventArg).
Dependencies on this module:
- Any component that manages chart UI state (e.g., view models, chart controls) likely subscribes to these events to react to user actions or model changes.
- The
SaveToPDFRequestedEventsuggests integration with a PDF export service (not visible here). - The
ChartAxisChangedEventandChartOptionsChangedEventimply coupling with chart rendering logic and data binding systems (e.g., MVVM framework).
5. Gotchas
- Misleading XML comments: All events (except
SaveToPDFRequestedEvent) have XML comments stating “The Data Folder changed event.” This is clearly incorrect and likely copy-paste error—do not rely on comments for semantics. - Typo in class name:
CursorsAlailableChangedEventusesAlailableinstead ofAvailable. This may cause confusion and should be corrected in future refactoring. - Ambiguous payload semantics: Boolean events use
boolpayloads, but it is unclear whethertruemeans enabled, visible, requested, or changed to true. Subscribers must infer meaning from context or external documentation. - No validation on
ChartAxisChangedEventArg: No checks ensureMinValue < MaxValueor thatAxisis a recognized identifier. Invalid values may propagate silently. - No documentation for
ChartTypevalues: TheChartTypestring inChartOptionsChangedEventArghas no documented set of valid values (e.g.,"Line","Bar"), risking runtime errors if unexpected values are used. - No versioning or deprecation markers: Events may evolve (e.g., payload changes), but no attributes or comments indicate stability or obsolescence.
None of the above are explicitly enforced in the source—these are inferred from inconsistencies and omissions.