Gets the unique identifier for the trace
The trace ID
ReadonlytraceThe trace's chart type, exposed without computing the full state.
ReadonlylayerHow the layer names itself in the chart description's layer tabs — the
producer's name when there is one, and the chart-type label otherwise.
Exposed here for the same reason Trace.traceType is: the tab strip
names every layer of a subplot, including the ones the reader has not
visited, and building each one's full state to read a label would compute
an audio, braille, text and highlight snapshot per layer per keypress.
ReadonlyplaceThe label of the axis a layer switch reads this layer's place along -- the place Trace.getCurrentXValue gives -- trimmed: the x axis's, or the y axis's for a layer drawn on its side, whose categories run up the side (a horizontal box plot, error bar or dumbbell); '' when the layer authored none, or is found along both of its axes, as a horizontal bar is. Exposed for the same reason Trace.traceType is: a layer switch asks it of the layer it leaves and the one it enters, to tell whether a number read on one is a place on the other.
ReadonlylevelWhich level of the figure this element is, for the same reason
Trace.traceType exists: state.type answers it too, but only
after building the whole audio/braille/text/highlight snapshot.
Runs the given moves with this trace's observers muted, so a relocation
the reader did not ask for does not announce itself. See
AbstractPlot.runSilently.
Gets the current X value from the trace
The current X value or null if not available
Moves the trace to the position that matches the given X value
The X value to move to
True if the position was found and set, false otherwise
OptionalgetA second X the reader's position reads as, which a layer switch may carry
instead of Trace.getCurrentXValue; Subplot.carriedXValue says
when. Optional; a horizontal bar offers its category here, its magnitude
being its X.
OptionalhasWhether a mark sits at exactly this X, as Trace.moveToXValue finds one before it falls back to the nearest. Optional; asked only to choose between the two X values of Trace.getAlternateXValue.
OptionalgetGet the current Y value from the trace. Optional method implemented by traces that support Y value preservation during layer switching.
The current Y value or null if not available
OptionalmoveMove to a specific X value and find the closest position with the given Y value. Optional method implemented by traces that support preserving both X and Y values during layer switching.
The X value to move to
The Y value to find the closest matching position for
true if the move was successful, false otherwise
OptionalgetThe section of a sectioned mark the cursor stands on -- a box plot's "25%" or "Maximum". Optional; implemented by traces whose position is a mark and a part of it, so a layer switch between two of them keeps both.
The section, or null when there is none
OptionalmoveMoves to the mark a layer switch carried over, standing on the given section of it. Optional; see Trace.getCurrentSection.
The X value to move to
The section to stand on
true if the move was successful, false otherwise
Notify observers that the trace is out of bounds
Resets the trace to initial entry state
OptionalcursorThe part of the cursor a trace keeps beside row/col that should
survive a live data update -- a candlestick's segment. Context
captures it before the update and hands it to restoreCursor.
The key is opaque: it means something only to the same kind of trace
that returned it. Optional; pairs with restoreCursor.
The key, or null when there is none
OptionalrestoreRe-derives the navigation state a trace keeps beside row/col from
them. Context calls it after restoring row/col onto a trace that a
live data update rebuilt; a trace that navigates by row/col alone
does not implement it.
Optionalkey: string | nullWhat cursorKey returned on the trace before the update
Computes the trace state at an arbitrary position without moving the cursor or notifying observers (used by monitor mode).
The row of the position to compute state for
The column of the position to compute state for
The trace state at the requested position
Notifies all observers with a specific state
The trace state to send to observers
Get all highlight SVG elements for this trace Used by HighlightService for high contrast mode
Array of all SVG elements, or empty array if none
OptionalgetThe elements whose geometry is the trace as the chart drew it, when that differs from the highlight elements.
Optional, and empty rather than absent when a trace has nothing extra to
offer, so a caller can fall back to the highlight elements in one check.
Implemented by traces whose highlight markers stand in for a shape rather
than being it -- a line whose per-point circles maidr synthesised from the
rendered <path>, where the path is the geometry and the circles are only
the vertices on it.
The drawn elements, or an empty array when there are none
Moves to the nearest point at (x, y) and returns directional guidance
toward the nearest data geometry in a single call. Combining the two
operations avoids running findNearestPoint twice per pointer event.
For ViolinKdeTrace, coordinates map to (violin index, y-value within KDE curve); for ViolinBoxTrace, to (section index, violin index) for vertical orientation, or the inverse for horizontal.
Screen-space x position in viewport pixels
Screen-space y position in viewport pixels
Guidance state, or null when unavailable for this plot level
OptionalgetGets extrema targets for navigation. Optional method implemented by traces that support extrema navigation.
Array of extrema targets
OptionalnavigateNavigate to a specific extrema target. Optional method implemented by traces that support extrema navigation.
The extrema target to navigate to
OptionalextremeWhat a jump to the left or right extreme is refused with, when the trace has a reason the edge signal would misstate: on a flow whose largest flows go round in a cycle, there is no end to jump to, and the next arrow still moves. Optional, and null where the jump is made as usual.
Which way the jump goes
What to tell the reader, or null
OptionalgetEvery object the o list offers, or null on a chart walked along axes.
The list, or null
OptionalmoveMoves to the object the list knows by this key.
The object's key
True when the cursor moved
Interface representing a trace with navigation and observation capabilities