Initializes the controller with all necessary services, view models, and bindings.
The MAIDR configuration object containing plot data and settings
The HTML element containing the plot to be made accessible
The Redux store instance for this plot's state management
What the reader had when they last left this chart, to put back before anything is built on the model
Captures what the reader has in this chart, for the controller built when they come back to it.
The reader's position and modes
Picks up where the reader left off: reopens braille if it was open and announces the point they are back on, the way a move to it would.
Runs once, on the focus-in that built this controller, in place of the initial instruction -- a reader coming back needs to know where they are, not how to start.
False when there is no position to resume, and the caller shows the initial instruction instead
Displays the initial instruction in the text view without announcing it to screen readers.
Moves the reader to a position the host chose -- the mark a sighted user clicked in the host's own chart.
The target is checked before anything is touched: a position the figure does not have is refused with the delta layer, the grid cell and the rotor mode all exactly as they were. Only then are the modes that re-route the arrow keys left, the way a data update leaves them -- the candlestick delta layer closed silently, a rotor mode (grid, point, intersection) reset to data mode, since the target is spelled in the trace's data coordinates and would land somewhere else read through a mode's own cursor -- and the model does the move and announces the landing point once.
The layer and the cell or data point to land on
True when the cursor moved there; false leaves everything as it was
Whether the reader is somewhere a keyboard move to another point is not available -- a MAIDR dialog (chat, settings, help, the command palette, go-to-extreme, the object list), the braille or review field, or a label chord.
navigateTo leaves only the modes that re-route the arrow keys (grid cell, candlestick delta, rotor); it does not close a dialog, and a move made under one switches the keyboard scope out from beneath it. A caller acting on its own schedule, such as an in-browser agent, asks this first.
True while such a scope is active
Runs one of the reader's commands for a caller acting on its own schedule, such as an in-browser agent.
Goes through the executor the command palette uses, in the scope the reader is in, so it does what their key would do there -- an arrow move stops autoplay first, as the arrow keys do -- and nothing where that key does nothing.
The keymap's name for the command
now when it ran, unavailable when the reader's scope has no
key for it or the key would silently do nothing there, and blocked
while isCommandBlocked
Whether the reader is in a MAIDR dialog, a text field or a label chord, where runCommand refuses.
Unlike isNavigationBlocked, the braille field does not count: it is where a braille reader reads the chart from, and its own keymap decides which commands run there.
True while such a scope is active
The reader's modes, read without changing or announcing anything.
What the palette's toggles and autoplay keys would change
StaticstartingThe modes a controller built from a session would have once it resumed, for a caller asking while no controller is alive.
Monitoring, autoplay and the rotor mode are not carried over, so a new controller always starts them off and in data mode; high contrast is a saved setting. Braille comes back where resume reopens it: on the reader's point, or, with no point to return to, on the first layer a one-panel figure starts on -- not on the overview of several panels.
What the reader had when they left, or null
The data the next controller is built from
The modes the next controller starts with
The text the reader's screen reader last spoke for their position -- the point, its axis labels and values -- as the text mode renders it.
Read-only: asking changes nothing and announces nothing.
The position text, or null before the reader has landed on a
data point
Initialize high contrast mode if enabled in settings. Call this after the Controller is fully set up and will persist (not the throwaway init).
Suspend high contrast mode visually (restore original colors). Call this on blur to return the chart to its original appearance.
Replaces the chart data in place (live/realtime update).
Rebuilds the model layer (Figure/Subplot/Trace) from the new data while preserving the user's navigation position, then rewires all observers. Services, view models, and keybindings are untouched, so the update is cheap enough for streaming scenarios.
The swap itself is silent; when monitor mode is enabled and the update appended a point, that point is sonified and announced without moving the user's position.
The complete replacement MAIDR config (caller-owned copy)
Optionalappended: AppendedPointInfoLocation of the newly appended point, for appendData updates
Cleans up all services, view models, and event listeners.
Returns the context value for React dependency injection. Used by the React component tree to access view models and command executor.
Main controller class that orchestrates all services, view models, and interactions for the MAIDR application.