Handle layer switching within a subplot. Encapsulates business logic for preserving positions, invoking trace-specific switch handling, and notifying observers about layer switches.
The newly active trace (may be the same as the previous one) or null if unavailable.
Compute normalized point index and segment type based on orientation
The row coordinate from UI/ViewModel
The column coordinate from UI/ViewModel
The data orientation
Array of available section names (e.g., ['open', 'high', 'low', 'close'])
Object containing pointIndex and segmentType
Compute visual coordinates for highlighting based on orientation
The data point index
The segment position (e.g., dynamic sorted position)
The data orientation
Object containing row and col for visual highlighting
Extract X value from points array based on current position.
Array of points (single or multi-row)
The row index
The column index
The extracted X value or null if not found
Extract X value from values array based on current position.
2D array of values
The row index
The column index
The extracted X value or null if not found
Navigate to a specific X value within the points array and invoke callback with new position.
Array of points (single or multi-row)
The target X value to navigate to
Callback function to execute when position is found
True if navigation was successful, false otherwise
Navigate to a specific X value within the values array and invoke callback with new position.
2D array of values
The target X value to navigate to
Callback function to execute when position is found
True if navigation was successful, false otherwise
Cleanup method to dispose of service resources.
NavigationService handles orientation-specific coordinate transformations and navigation logic that was previously mixed into Core Model classes.
This service encapsulates the business logic for translating between UI coordinates (row, col) and model coordinates (pointIndex, segmentType) based on data orientation, as well as X-value navigation across trace types.