Skip to main content

Module ui

Module ui 

Source
Expand description

Shared pieces of the full-screen views, legume-tui’s: the screen loop and the chrome (legume_tui::view), histogram scales, binning and plots (legume_tui::hist), all drawn in data-beans’ LOOK.

Structs§

Binned
A sorted statistic binned on a scale: the bins and their counts.
Binning
Equal-width bins on a scale, keyed by integers from 0 at 0. The log scale is the Axis every histogram reads values on: ln(shift + x), the shift 1 for counts and smaller for values mostly below 1.
HistPlot
A histogram of counts over bins kmin.., scaled to them.
Look
Styles for a popup or a strip. Built with Look::new or Look::terminal: more styles may come, so not field by field.
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 kill asks the views to stop (Screen::quit, 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§

LOOK
The views’ styles: the terminal’s own foreground (so light and dark backgrounds both work) for nearly everything, dim for what is secondary, and [ACCENT].
TICK
How often a view’s loop asks Screen::tick, keys or not.

Traits§

BarValue
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 Tui::run or run_screen.

Functions§

compact
Compact number for axis labels: 950, 1.2k, 35k, 1.1M; small fractions keep two significant digits.
copy
Ask for text on the clipboard (pbcopy, else the terminal’s OSC 52). Whether a terminal took it cannot be known.
header
Title row: a reverse-video badge naming the view, then title, then extra dim.
help_line
Help line from (key, what it does) pairs: each key in the accent in bold, what it does dim (crate::widgets::key_line).
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: the page’s border and the accent title when focused, the look’s border otherwise.
run_screen
Run screen full screen until it is done, in a plain session of data-beans’ own. The terminal is restored on return and on panic.
run_screen_in
run_screen in session: hosted, it keeps running when the connection drops and a kill stops it (Screen::quit). 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.
title_bar
Title row: title (a header) with the session keys, keys (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.