Renderables
A collection of Rich renderables which may be returned from a widget's render()
method.
Bar
class
¶
def __init__(
self,
highlight_range=(0, 0),
highlight_style="magenta",
background_style="grey37",
clickable_ranges=None,
width=None,
):
Thin horizontal bar with a portion highlighted.
Parameters
Parameter | Default | Description |
---|---|---|
highlight_range
tuple[float, float]
|
(0, 0)
|
The range to highlight. |
highlight_style
StyleType
|
'magenta'
|
The style of the highlighted range of the bar. |
background_style
StyleType
|
'grey37'
|
The style of the non-highlighted range(s) of the bar. |
width
int | None
|
None
|
The width of the bar, or |
LinearGradient
class
¶
Sparkline
class
¶
def __init__(
self,
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
Parameter | Default | Description |
---|---|---|
data
Sequence[T]
|
required | The sequence of data to render. |
width
int | None
|
required | The width of the sparkline/the number of buckets to partition the data into. |
min_color
Color
|
Color.from_rgb(0, 255, 0)
|
The color of values equal to the min value in data. |
max_color
Color
|
Color.from_rgb(255, 0, 0)
|
The color of values equal to the max value in data. |
summary_function
SummaryFunction[T]
|
max
|
Function that will be applied to each bucket. |