Skip to main content

facts

Function facts 

Source
pub fn facts(
    ui: &mut Ui,
    facts: &[Fact<'_>],
    palette: &Palette,
    id: impl Into<Id>,
)
Expand description

A figure: the value, then what it counts under it.

The tone lands on the value and its change rather than on the caption, which is what Figure::tone means: the figure is an ordinary fact and it is the movement that reads as good or bad. makeover-tui says the same thing with a bold span; here it is a larger one, because egui can size text and a terminal cannot. Labelled facts, with their values in one column.

The alignment is the member, and egui::Grid is how this renderer gets it: a grid measures its widest cell per column and lays every row to that, which is the same answer max-content gives a webview and padding gives a terminal. Five goingson panes were drawing a row per fact, and every value started after its own label.

The grid is not striped. Grid::striped is the obvious reach and it is wrong here: a stripe says “these rows are a series you scan down”, which is a table’s claim. A pane of facts is one object read as a whole.

The label reads back and the value takes content, which is figure’s rule for a value against its caption. A fact with nothing to say never arrives: Node::facts drops it as it builds.