Skip to main content

Module ui

Module ui 

Source
Expand description

Shared pieces of the full-screen views: the palette, panels, header and help lines, the event loop, histogram scales and binning, and a histogram plot with a y gutter, an x axis, and markers.

Structs§

Binned
A sorted statistic binned on a scale: the bins and their counts.
Binning
Equal-width bins on a scale, keyed by integers. On the log scale these are the printed histogram’s tenth-decade bins, keyed by rounding.
HistPlot
MirrorPlot
Two bar series on one scale around a zero line, one growing up and the other down, as a Miami plot, in half cells. Signed values are a mirror of their positive and negative parts. Axes as HistPlot’s, one column per bar.
MirrorSide
One side of a MirrorPlot.
Tui
The terminal a command’s views draw on, in the command’s session: up from the first view (Tui::run) until dropped, so every view of the command and the work between them (Tui::work) share one screen. While it is up, a data-beans kill asks the views to stop as Ctrl-C does (Tui::stop_requested), and work under way finishes first. Log records raised while it is up are held back and written once the normal screen is back, or as work between views runs.

Enums§

Scale
How a histogram axis is drawn.

Constants§

ACCENT
ACCENTED
Accent bars and marks.
DIM
Secondary text: labels, axes, units.
HIGHLIGHT
Key names in help lines, typed values, and the value in focus.
PLAIN
Plain text and bars in the terminal’s foreground.
TICK
How often a view’s loop asks Screen::tick, keys or not.

Traits§

BarValue
A histogram of counts over bins kmin.., scaled to them. A bar height HistPlot can draw: whole counts, or any non-negative real value (a summed signal, a log statistic).
Screen
A full-screen view driven by run_screen.

Functions§

compact
Compact number for axis labels: 950, 1.2k, 35k, 1.1M; small fractions keep two significant digits.
header
Title bar: a reverse-video badge naming the view, then plain text.
help_line
Help line from (key, what it does) pairs.
input_line
Footer while typing: prompt, the text so far with a cursor, then keys.
median
Median of an ascending slice (0 when empty).
modes_of
The terminal modes screen asks for, as its session turns them on (and on again after every attach): the mouse as buttons and the wheel in SGR form, not the pointer’s every move, which would wake the loop for nothing; keys held with modifiers told apart.
notify
Ring the terminal’s bell and ask it for a desktop notification saying text (OSC 9); terminals without either ignore them.
panel
Rounded panel titled title: plain border and accent title when focused, dim border otherwise.
run_screen
Run screen full screen until it is done, in a plain session of its own (Session::plain). The terminal is restored on return and on panic. See Tui::run_with for the rest.
run_screen_in
run_screen in session: hosted, it keeps running when the connection drops and a kill stops it as Ctrl-C does. The screen is handed back on return; Tui keeps it up across several views.
run_screen_in_with
run_screen_in, with each key (but Ctrl-C) handed to on_key.
run_screen_with
run_screen, with each key (but Ctrl-C) handed to on_key rather than Screen::handle_key: for a caller with rules of its own about which keys a screen sees.
title_bar
Title bar: title (a header) with the session keys, keys (super::session_keys), at its right end. The keys stay whole however narrow the terminal, the title giving way, so the detach key is always on screen.