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

    Class AnnounceYCommand

    Command to describe the Y-axis label.

    Hierarchy

    • AnnounceCommand
      • AnnounceYCommand
    Index

    Constructors

    Properties

    context: Context
    textViewModel: TextViewModel
    audioService: AudioService
    textService: TextService
    displayService: DisplayService

    Methods

    • Restores the scope to the previous scope before entering label mode. Uses DisplayService to properly manage the focus stack and restore the correct scope (TRACE, BRAILLE, etc.) regardless of which scope was active before entering label mode.

      Only exits when a label scope (TRACE_LABEL or FIGURE_LABEL) is actually active. Every current caller (announce x/y/z/title/subtitle/caption) is bound only inside a label scope, so this guard is defensive: it keeps the command safe if a future keybinding ever invokes it from a non-label scope, where exiting unconditionally would flip navigation into TRACE scope via the stale focus stack and break subplot activation.

      Returns void

    • Resolves the populated trace state whose labels (x / y / z) should be announced, regardless of the current navigation level:

      • trace level: the active trace itself;
      • figure lobby (multi-panel) or subplot level: the currently focused subplot's active trace. In a facet figure every panel shares the same axes, so this is the figure-wide label; in a general multi-panel figure each panel may differ, so the announcement tracks whichever subplot the cursor is on (and updates as the user navigates between subplots).

      Returns null when no populated trace is reachable (e.g. an empty state), so callers can fall back to an "unavailable" announcement.

      Returns
          | {
              empty: false;
              type: "trace";
              layerId: string;
              traceType: TraceType;
              plotType: string;
              title: string;
              xAxis: string;
              yAxis: string;
              z: string;
              hasMultiPoints: boolean;
              audio: AudioState;
              braille: BrailleState;
              text: TextState;
              autoplay: AutoplayState;
              highlight: HighlightState;
              intersections?: AudioState[]
              | null;
              groupCount?: number;
              orientation?: Orientation;
          }
          | null

      • {
            empty: false;
            type: "trace";
            layerId: string;
            traceType: TraceType;
            plotType: string;
            title: string;
            xAxis: string;
            yAxis: string;
            z: string;
            hasMultiPoints: boolean;
            audio: AudioState;
            braille: BrailleState;
            text: TextState;
            autoplay: AutoplayState;
            highlight: HighlightState;
            intersections?: AudioState[] | null;
            groupCount?: number;
            orientation?: Orientation;
        }
        • empty: false
        • type: "trace"
        • layerId: string

          Unique identifier for the layer/trace

        • traceType: TraceType
        • plotType: string
        • title: string
        • xAxis: string
        • yAxis: string
        • z: string
        • hasMultiPoints: boolean
        • audio: AudioState
        • braille: BrailleState
        • text: TextState
        • autoplay: AutoplayState
        • highlight: HighlightState
        • Optionalintersections?: AudioState[] | null

          Array of audio states for all lines that intersect at the current point. Used for intersection-aware audio playback in multiline plots. null/undefined for normal points (single line or no intersection).

        • OptionalgroupCount?: number

          Number of groups/series in the plot. Only present for multiline plots where plotType === 'multiline'.

        • Optionalorientation?: Orientation

          Plot orientation, if applicable (e.g. bar, box, violin).

      • null
    • Prefix that names which subplot an announced label belongs to.

      At the multi-panel figure lobby the cursor sits on one subplot at a time and each panel may carry different axes, so an axis/level announcement is prefixed with the focused subplot's position (e.g. "Subplot 2, "). Returns an empty string once the user is inside a subplot (trace/subplot level) or in a single-panel figure, where the source is already unambiguous — and in terse mode, which stays minimal by design.

      Returns string

    • The authored figure-wide axis label to announce at the multi-panel figure lobby, or null when none was authored (so the caller falls back to the focused subplot's own axis). Only applies at the lobby (figure state): once the user is inside a subplot the trace's own axis is authoritative, so this returns null there and existing single-panel behavior is untouched.

      Parameters

      • axis: "x" | "y"

        Which figure-wide axis label to resolve.

      Returns string | null

    • Shared X/Y axis announcement: an authored figure-wide label wins at the lobby ("Figure X label is ..."), otherwise the focused subplot's own axis is used ("Subplot N, X label is ...") — falling through to "not available" when no populated trace is reachable. Z is intentionally not routed here: it reads a different field (text.z) with different wording and has no figure-wide equivalent.

      Parameters

      • axis: "x" | "y"

        Which axis to announce.

      Returns void

    • Executes the command to display the Y-axis label.

      Precedence at the figure lobby: an authored figure-wide Y label wins ("Figure Y label is ..."); otherwise resolveActiveTraceState reads the focused subplot's trace ("Subplot N, Y label is ..."). Inside a subplot / single-panel the trace's own axis is used unchanged. A blank or whitespace-only label is announced as "not available".

      Returns void