yera.runtime.handlers._charts.base
Shared abstract base and environment mixins for all chart handlers.
Symbols
BaseChartHandler
Abstract base for all chart handlers.
Subclasses set _data_class to the expected payload type and implement
_figure_geometry(), _emit(), and _render_png(). push()
is provided here and requires no further overriding.
Methods
BaseChartHandler.push
push(
event: OutputEvent,
) → NoneType-check the event payload, render, and emit.
Parameters
An output event carrying chart block data.
Raises
If the event data is not the expected type for this chart.
JupyterChartMixin
Environment mixin supplying fixed Jupyter figure geometry and emission.
Intended for use as the left-most base alongside a BaseChartHandler
subclass, e.g. class JupyterBarChartHandler(JupyterChartMixin, BaseBarChartHandler).
KittyChartMixin
Environment mixin supplying Kitty-terminal figure geometry and emission.
Intended for use as the left-most base alongside a BaseChartHandler
subclass, e.g. class KittyBarChartHandler(KittyChartMixin, BaseBarChartHandler).
Methods
KittyChartMixin.__init__
__init__(
console: Console,
) → NoneInitialize Kitty chart geometry from the destination console.
Parameters
Rich console whose dimensions constrain rendered charts.