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 |
---|---|---|---|
highlight_range |
tuple[float, float]
|
The range to highlight. |
(0, 0)
|
highlight_style |
StyleType
|
The style of the highlighted range of the bar. |
'magenta'
|
background_style |
StyleType
|
The style of the non-highlighted range(s) of the bar. |
'grey37'
|
width |
int | None
|
The width of the bar, or |
None
|
gradient |
Gradient | None
|
Optional gradient object. |
None
|
LinearGradient ¶
Sparkline ¶
Sparkline(
data,
*,
width,
min_color=Color.from_rgb(0, 255, 0),
max_color=Color.from_rgb(255, 0, 0),
summary_function=max
)
Bases: Generic[T]
A sparkline representing a series of data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Sequence[T]
|
The sequence of data to render. |
required |
width |
int | None
|
The width of the sparkline/the number of buckets to partition the data into. |
required |
min_color |
Color
|
The color of values equal to the min value in data. |
Color.from_rgb(0, 255, 0)
|
max_color |
Color
|
The color of values equal to the max value in data. |
Color.from_rgb(255, 0, 0)
|
summary_function |
SummaryFunction[T]
|
Function that will be applied to each bucket. |
max
|