Constructs a TextService instance with notification support.
The notification service for user alerts
Optionalformatter: FormatterServiceOptional formatter service for custom value formatting
The current text mode, for carrying it over to the controller built when the reader comes back to the chart.
The current text mode
Disposes of event emitters and releases resources.
Get coordinate information from the current state Returns null if no valid state is available
The focused point described in full, whatever the text mode is.
Terse and OFF modes shorten or silence what the reader hears, but the AI needs the whole description of the point, so this always formats the verbose way. Reads the last navigation state and leaves the mode alone.
The verbose description, or null when nothing is focused
Formats plot state into human-readable text based on current mode.
The state to format (string or PlotState object)
Formatted text representation of the state
Builds the spoken cue for ENTERING a subplot from the multi-panel figure lobby, respecting the current text mode:
null (only the enter tone signals the transition);Lives here (not in the command layer) so all lobby wording and its terse/verbose rules share one home with formatFigureText.
1-based visual position of the entered subplot.
Total number of subplots in the figure.
The entered trace's plot type ('' to omit).
The entered subplot's authored title ('' when none).
The message to announce, or null when text mode is OFF.
Builds the wording for a subplot that has nothing to describe — one the
producer authored with an empty layers array, which is legitimate for an
unoccupied cell in a non-rectangular grid or a panel whose geom MAIDR does
not support yet. Respects the current text mode:
null;Shared by the lobby navigation text (formatFigureText) and the refused-entry cue, so both name the panel the same way.
1-based visual position of the subplot.
Total number of subplots in the figure.
The subplot's authored title ('' when none).
The message to announce, or null when text mode is OFF.
Builds the spoken cue for EXITING a subplot back to the multi-panel figure lobby, respecting the current text mode:
null (only the exit tone signals the transition);Shares the lobby wording rules with subplotEntryText and formatFigureText.
The figure lobby state returned to.
The focused subplot's authored title ('' when none).
The message to announce, or null when text mode is OFF.
Updates the service with new plot state and emits appropriate events.
The new plot state to process
Toggles between text modes (OFF, TERSE, VERBOSE) in sequence.
True if text mode is now active (not OFF), false otherwise
Checks if the text service is in verbose mode.
True if text mode is set to verbose, false otherwise
Checks if the text service is in terse mode.
True if text mode is set to terse, false otherwise
Checks if the text service is turned off.
True if text mode is set to off, false otherwise
Sets the text mode without announcing it: the reader chose it before they left the chart, and hearing it again on return would be noise.
The mode to put back
Service for managing text output and formatting of plot state information.