Raxol.UI.ElementRenderer (Raxol v2.9.2)

View Source

Handles rendering of specific UI element types (box, text, table, panel).

Summary

Functions

Builds table attributes with data and styles.

Renders a table element into its width x height box.

Renders a text element. Text starting left of column 0 or above row 0 (content scrolled past the screen's edge) draws only its on-screen part: lines above row 0 are skipped, and so are the graphemes left of column 0, a wide one straddling it included.

Functions

build_table_attrs(table_element, headers, data, column_widths)

Builds table attributes with data and styles.

render_box(x, y, width, height, style, theme)

Renders a box element.

render_panel(x, y, width, height, panel_element, theme, parent_style)

Renders a panel element with children.

render_table(x, y, width, height, attrs, theme)

Renders a table element into its width x height box.

attrs.border (default :none, as for boxes: the layout always stamps it) names the frame: a glyph set from Raxol.UI.Theming.BorderChars drawn round the box, with the header rule under the header row, and each cell inset by a column. :none draws neither: the header row, then the data rows straight under it. Either way a cell draws inside its column.

render_text(x, y, text, style, theme)

Renders a text element. Text starting left of column 0 or above row 0 (content scrolled past the screen's edge) draws only its on-screen part: lines above row 0 are skipped, and so are the graphemes left of column 0, a wide one straddling it included.