Creates a new Subplot instance from MAIDR subplot data
The MAIDR subplot data containing layers
Protected ReadonlyobserversProtectedisProtectedisTrue while AbstractTrace.getStateAt computes state at a temporarily moved cursor. Enforces (structurally, not just by documentation) that state getters never notify observers.
Protected ReadonlymovableReadonlytracesReadonlytraceReadonlyprimaryTitle of the subplot's first layer, used as the subplot title in description summaries. Empty string when no layer title was provided.
ProtecteddimensionProtectedvaluesIndex of the active layer within the subplot.
Traces are constructed as one single-trace row per layer
(traces[layerIndex][0]), so the active trace row IS the layer index.
This accessor makes that invariant explicit for callers (e.g. the
Controller's sliding-window cursor tracking) instead of having them
depend on the internal layout.
ProtectedoutReturns the pre-resolved parent <g id="axes_*"> element for this subplot.
This is set externally via setAxesElement during layout resolution
and does not perform any DOM queries.
The axes SVGElement, or null if not resolved.
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
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
Gets the number of traces in the subplot
The size (number of traces)
Override moveOnce to avoid "initial entry" no-op behavior for layer navigation.
For multi-layer subplots, the MovableGrid is used to step between layers (traces). We don't want the first PageUp/PageDown to be eaten by handleInitialEntry; instead, it should actually switch layers.
Gets the subplot state with figure position context
The row position in the figure
The column position in the figure
The subplot state
Returns the subplot's own SVG highlight element (resolved from subplot.selector).
Used by the layout utility to locate the parent axes group.
The SVG element, or null if the subplot has no selector.
Returns the CSS selector string from the first layer of this subplot.
Used as a fallback by the layout utility when getHighlightElement() is null.
The selector string, or null if unavailable.
Sets the pre-resolved axes element for this subplot. Called by Figure.applyLayout during initialization.
The axes SVGElement to store.
Interface for plot traces that support keyboard navigation and movement.