textual.renderables
A collection of Rich renderables which may be returned from a widget's render()
method.
Bar
¶
Bar(
highlight_range=(0, 0),
highlight_style="magenta",
background_style="grey37",
clickable_ranges=None,
width=None,
gradient=None,
)
Thin horizontal bar with a portion highlighted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
tuple[float, float]
|
The range to highlight. |
(0, 0)
|
|
StyleType
|
The style of the highlighted range of the bar. |
'magenta'
|
|
StyleType
|
The style of the non-highlighted range(s) of the bar. |
'grey37'
|
|
int | None
|
The width of the bar, or |
None
|
|
Gradient | None
|
Optional gradient object. |
None
|
LinearGradient
¶
Sparkline
¶
Sparkline(
data,
*,
width,
min_color=from_rgb(0, 255, 0),
max_color=from_rgb(255, 0, 0),
summary_function=max
)
Bases: Generic[T]
A sparkline representing a series of data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Sequence[T]
|
The sequence of data to render. |
required |
|
int | None
|
The width of the sparkline/the number of buckets to partition the data into. |
required |
|
Color
|
The color of values equal to the min value in data. |
from_rgb(0, 255, 0)
|
|
Color
|
The color of values equal to the max value in data. |
from_rgb(255, 0, 0)
|
|
SummaryFunction[T]
|
Function that will be applied to each bucket. |
max
|