yera.runtime.handlers._charts.base

Shared abstract base and environment mixins for all chart handlers.

Symbols

class BaseChartHandler — Abstract base for all chart handlers.
class JupyterChartMixin — Environment mixin supplying fixed Jupyter figure geometry and emission.
class KittyChartMixin — Environment mixin supplying Kitty-terminal figure geometry and emission.

BaseChartHandler

Inherits: BaseHandler, Generic[TData]

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

push — Type-check the event payload, render, and emit.

BaseChartHandler.push

push(
    event: OutputEvent,
) → None

Type-check the event payload, render, and emit.

Parameters

event
type: OutputEvent

An output event carrying chart block data.

Raises

TypeError

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

__init__ — Initialize Kitty chart geometry from the destination console.

KittyChartMixin.__init__

__init__(
    console: Console,
) → None

Initialize Kitty chart geometry from the destination console.

Parameters

console
type: Console

Rich console whose dimensions constrain rendered charts.