Phosphor::SparkLineMock
Inherits Phosphor::MockWidget < Reference < Object
A rolling time-series spark line rendered as a row (or stacked block) of Unicode block characters.
Generic and app-agnostic: no knowledge of AppState, Msg, or the
application theme. The Widget wrapper resolves theme → Style values
and sets them in Props before each render.
Display-only: SparkLineMock has no WidgetState of its own and no
Cmds to respond to — handle_cmd always returns CmdResult::None. It
is driven entirely by Props#values, so a new reading is shown simply by
passing an updated Props on the next render.
Constants
A Style that clears fg/bg back to the terminal's own default,
explicitly (Color::Default, not nil) — see Buffer#set_string's
doc comment on why that distinction matters when padding cells that
might sit over a previously-styled background.
The eight block-element glyphs, in ascending fill order, used to
render a value's relative height — both for render_single_row's
one-glyph-per-value mode and as the per-row fill granularity in
render_multi_row's stacked mode.
Constructors
Initialises the spark line with props and an optional state.
Instance methods
SparkLineMock is purely display-driven by Props — it has no Cmds
of its own, so this always returns CmdResult::None.
Renders the rightmost frame.width values of props.values into
buf within frame.
At frame.height == 1, each value draws as a single block glyph
(render_single_row). At any greater height, values are drawn as a
stacked bar chart spanning every row (render_multi_row). Does
nothing if props.values is empty or frame has no area.