Creates a new Figure instance from MAIDR data.
After construction, call applyLayout with the result of
resolveSubplotLayout() to set visual ordering and axes references.
The MAIDR data containing figure information and subplots
Protected ReadonlyobserversProtectedisProtectedisTrue while AbstractTrace.getStateAt computes state at a temporarily moved cursor. Enforces (structurally, not just by documentation) that state getters never notify observers.
ReadonlyidProtectedmovableReadonlytitleReadonlysubtitleReadonlycaptionReadonlyxReadonlyyReadonlysubplotsReadonlysizeProtecteddimensionProtectedvaluesGets the currently active subplot based on row and column position
The active subplot
Gets the current state of the figure including active subplot
The complete figure state
ProtectedhighlightProtectedoutRuns action with this element's observers muted.
A cursor move normally is the announcement -- moveToIndex notifies, and
everything downstream of it speaks, brailles and highlights. That is wrong
for a move the reader did not make and is not waiting to hear: the
description dialog's layer tabs relocate the reader in the chart while the
modal is open, and the trace's announcement would land in the same live
region the dialog is using, so one of the two is dropped. The caller
announces afterwards, once, when the reader is back on the chart.
Nesting is safe and the flag is restored on every path, including a throw, because a flag left raised would silence the chart for good.
The moves to make in silence
ProtectedgetGets safe row and column indices to prevent accessing undefined values
Object with safe row and column indices
Registers an observer to receive state updates.
The observer to add
Removes an observer from receiving state updates.
The observer to remove
Notifies all registered observers with the current state.
Notifies observers that an out-of-bounds condition occurred.
Base implementation of navigation in HIGHER and LOWER modes of ROTOR, default is no-op Needs to be implemented in Line, Bar, Heatmap, Candlestick
Utility function to compare point values for rotor functionality
boolean value
ProtectedcompareRotor compare search along one row of numeric values.
Steps from the current column in the given direction and moves to the first value that satisfies the comparison; reports the rotor boundary when nothing further qualifies. For the traces whose values are a plain numeric grid indexed [row][col]; a trace with a richer layout (the bar's orientation-normalised rows, the candlestick's segments) keeps its own.
The values of the row being searched
Which way to search
Whether a lower or a higher value is sought
True when a matching value was found and moved to
Returns true if this trace supports compare (lower/higher value) navigation. Override to false for trace types that don't use compare modes (e.g., scatter, which is all we currently have).
Returns the display name for the default data navigation mode. Override to provide a trace-specific name (e.g., "ROW AND COLUMN NAVIGATION" for scatter).
Returns the rotor's compare-mode labels and boundary-message nouns. Override to rename the two compare units for a trace-specific semantic (e.g., the candlestick delta layer uses "above line" / "below line").
Moves the active point to the (x, y) pointer location and returns directional guidance toward the nearest data geometry.
Combines navigation and guidance into a single call so traces compute
findNearestPoint only once per pointer event. Default returns null
for non-trace contexts.
Screen-space x position of the pointer/finger
Screen-space y position of the pointer/finger
Guidance state, or null when unavailable
Applies pre-computed visual layout data to this figure and its subplots.
Must be called once after construction (and before the figure is used)
with the result of resolveSubplotLayout().
The pre-computed layout from the utility function.
Overrides navigation to conditionally invert vertical direction. When data row 0 is at the visual top, we invert UPWARD/DOWNWARD so that pressing Up arrow moves toward lower row indices (visual top).
Overrides extreme navigation with the same directional adjustment.
Overrides movability checks with the same directional adjustment, so the
check-then-move idiom (if (isMovable(d)) moveOnce(d)) stays consistent
with moveOnce/moveToExtreme on inverted layouts.
Cleans up all subplots and releases resources
Builds at-a-glance summaries of every subplot in the figure, ordered by visual position (top-left first). Returns an empty array for single-panel figures since there is nothing extra to surface.
Represents a figure containing one or more subplots