MAIDR Documentation - v3.39.0
    Preparing search index...

    Class RotorNavigationService

    Manages rotor-based navigation for the active trace via alt+shift+up and alt+shift+down

    Purpose:

    • Provide modal navigation over a trace by rotating through three modes.

    Navigation modes:

    • DATA_MODE: Default data browsing. Focus remains in the trace scope; no compare behavior.
    • LOWER_VALUE_MODE: Navigate to the next/previous data point with a lower y-value relative to the current point (supports left/right and, when available, up/down semantics).
    • HIGHER_VALUE_MODE: Navigate to the next/previous data point with a higher y-value relative to the current point (supports left/right and, when available, up/down semantics).

    Responsibilities:

    • Track the current rotor mode and expose helpers to cycle forward/backward across modes.
    • Coordinate scope focus: entering a compare mode (LOWER/HIGHER) may switch focus to the rotor scope; returning to DATA_MODE restores focus to the trace scope.
    • Delegate directional movement to the active AbstractTrace implementation using rotor-aware APIs, with a fallback to compare-based traversal when rotor methods are unavailable.

    Mode management:

    • getMode(): Returns the symbolic mode string for the current index.
    • setMode(): Applies mode side-effects (e.g., restore trace scope in DATA_MODE).
    • getCompareType(): Maps the current mode to 'lower' or 'higher' for compare operations (DATA_MODE falls back to 'lower').

    Dependencies:

    • Context: Provides the active trace and current scope.
    • DisplayService: Toggles UI focus between scopes (trace vs. rotor).
    • TextService: Reserved for user-facing feedback/messages and parity with other services.

    Notes:

    • UI-agnostic: this service contains no rendering logic and does not depend on the UI.
    • Returns user-facing messages from movement methods when a move is not possible; callers may surface these through the ViewModel/UI.
    Index

    Constructors

    Methods

    • Advances to the next rotor navigation mode.

      Returns string

      The name of the new rotor mode

    • Moves to the previous rotor navigation mode.

      Returns string

      The name of the new rotor mode

    • Gets the current rotor mode index.

      Returns number

      The current rotor index (0-2)

    • Moves to the next data point in the specified direction based on current compare mode.

      Parameters

      • direction: "left" | "right"

        The direction to move ('left' or 'right')

      Returns string | null

      Error message if move failed, null otherwise

    • Moves up to a data point with lower/higher value based on rotor mode.

      Returns string | null

      Error message if move failed, null otherwise

    • Moves down to a data point with lower/higher value based on rotor mode.

      Returns string | null

      Error message if move failed, null otherwise

    • Moves left to a data point with lower/higher value based on rotor mode.

      Returns string | null

      Error message if move failed, null otherwise

    • Moves right to a data point with lower/higher value based on rotor mode.

      Returns string | null

      Error message if move failed, null otherwise

    • Sets the rotor mode based on the current index and updates context state.

      Returns void

    • Gets the current rotor mode name.

      Returns string

      The name of the current rotor mode (e.g., 'DATA_MODE', 'LOWER_VALUE_MODE')

    • Gets the comparison type for the current rotor mode.

      Returns "lower" | "higher"

      'lower' or 'higher' based on the current mode

    • Parameters

      • nav_type: string
      • direction: string

      Returns string