Grid
Term.Grid
Term.Grid.collect_elements
Term.Grid.extract_renderable_from_kwargs
Term.Grid.get_elements_and_sizes
Term.Grid.grid
Term.Grid.grid
Term.Grid.grid
Term.Grid.parse_single_element_layout
Term.Grid
— ModuleAuthor(s): T Bltg (github.com/t-bltg)
Term.Grid.collect_elements
— Methodcollect_elements(ex::Expr)
Collects elements (individual LayoutElements) that are in a layout expresssion.
Term.Grid.extract_renderable_from_kwargs
— Methodextract_renderable_from_kwargs(s, h, w; kwargs...)
When passing kwargs to a Compositor
, check for renderables that are to be assigned to its content.
Term.Grid.get_elements_and_sizes
— Methodget_elements_and_sizes(ex::Expr)
Get elements names and sizes.
Term.Grid.grid
— Functiongrid(
rens::Nothing = nothing;
placeholder_size::Union{Nothing,Tuple} = nothing,
layout::Union{Nothing,Tuple,Expr} = nothing,
kw...
)
Construct a grid of PlaceHolder
s, for a given layout.
Term.Grid.grid
— Methodgrid(rens::AbstractMatrix; pad::Union{Tuple,Integer} = 0))
Construct a grid from an AbstractMatrix
.
Term.Grid.grid
— Methodgrid(
rens::Union{AbstractVector,Tuple,NamedTuple};
placeholder::Union{Nothing,AbstractRenderable} = nothing,
placeholder_size::Union{Nothing,Tuple} = nothing,
aspect::Union{Nothing,Number,NTuple} = nothing,
layout::Union{Nothing,Tuple,Expr} = nothing,
show_placeholder::Bool = false,
pad::Union{Tuple,Integer} = 0,
order::Symbol = :row,
)
Description
Construct a grid from an iterable (AbstractVector
, Tuple
, NamedTuple
).
Lays out the renderables to create a grid with the desired aspect ratio or layout (number of rows, number of columns, or one left free with nothing
). Complex layout is supported using compositor expressions.
Arguments
placeholder
: placeholder for empty grid components. placeholder_size
: size of the auto-placeholder. aspect
: target grid aspect ratio. layout
: tuple (rows, cols) final size or complex expression. show_placeholder
: display/hide placeholder(s). pad
: additional padding between layout components. order
: :row
for row major input iteration (default) or :col
for column major.
Term.Grid.parse_single_element_layout
— Methodparse_single_element_layout(ex::Expr)
Parse an expression with a single layout element, like :(A(5, 25)) or :(A)