Kino.Output (Kino v0.1.1) View Source

A number of output formats supported by Livebook.

Link to this section Summary

Types

An empty output that should be ignored whenever encountered.

t()

Livebook cell output may be one of these values and gets rendered accordingly.

Standalone text block.

Regular text, adjacent such outputs can be treated as a whole.

Interactive Vega-Lite graphic with data streaming capabilities.

Link to this section Types

Specs

ignored() :: :ignored

An empty output that should be ignored whenever encountered.

Specs

Livebook cell output may be one of these values and gets rendered accordingly.

Specs

text_block() :: {:text, binary()}

Standalone text block.

Specs

text_inline() :: binary()

Regular text, adjacent such outputs can be treated as a whole.

Specs

vega_lite_dynamic() :: {:vega_lite_dynamic, pid()}

Interactive Vega-Lite graphic with data streaming capabilities.

There should be a server process responsible for communication with subscribers.

Communication protocol

A client process should connect to the server process by sending:

{:connect, pid}

And expect the following reply:

{:connect_reply, %{spec: map()}}

The server process may then keep sending one of the following events:

{:push, %{data: list(), dataset: binary(), window: non_neg_integer()}}

Specs

vega_lite_static() :: {:vega_lite_static, spec :: map()}

Vega-Lite graphic.

spec should be a valid Vega-Lite specification, essentially JSON represented with Elixir data structures.

Link to this section Functions

Specs

inspect(term()) :: t()

Returns text_block/0 with the inspectd term.

Specs

text_block(binary()) :: t()

See text_block/0.

Specs

text_inline(binary()) :: t()

See text_inline/0.

Specs

vega_lite_dynamic(pid()) :: t()

See vega_lite_dynamic/0.

Specs

vega_lite_static(vega_lite_spec :: map()) :: t()

See vega_lite_static/0.