Skip to main content

Module column_widths

Module column_widths 

Source
Expand description

Each main-table column’s drawn width, kept by identity so the layout holds through paging, scrolling, reordering and resizing. Automatic widths are learned from the first page drawn (values already formatted, nothing read): text keeps it, bounded by text_cap and clipped beyond; numbers, dates and flags only grow (clipped they would read wrong). Sidebar-set widths win. A query, reshape, drill, sort or filter relearns automatic widths; paging and scrolling never do.

Structs§

ColumnWidths
Display widths by column identity (name and type): a retyped column starts afresh, one returning with its type keeps its width. Unrelated to the byte estimate that plans buffers.
PageMeasure
One column measured on the rows on screen, in cells, as the table draws it.

Enums§

WidthChoice
How a column’s width is chosen.

Constants§

MAX_WIDTH
MIN_WIDTH
The narrowest and widest a width set by hand may be.
UNSEEN_WIDTH
Where narrower or wider starts on a column that has not been drawn yet.
WIDTH_STEP
Cells one narrower or wider press moves a width.

Functions§

text_cap
The most cells an automatic width gives text or a heading: two fifths of the terminal (32 at 80 columns), between 16 and 64. From the terminal, not the table, so a sidebar moves nothing; a resize does.