7.2.4.3. Module axivion.dashboard.visualization.output¶
Outputters of the Dashboard Visualization API.
Classes¶
|
Widget which displays other widgets in a grid layout. |
|
Widget that renders the given Markdown string. |
|
Root widget container. |
|
Widget that outputs plain text - without any formatting. |
|
Widget that outputs SVG. |
|
Widget that outputs tabular data. |
|
Widget that outputs Vega JSON. |
Grid¶
- class axivion.dashboard.visualization.output.Grid(out, indentation_level, columns, cache_config=None)¶
Bases:
CloseableWidget which displays other widgets in a grid layout.
The methods to write the sub-widgets each take an optional style argument which is a mapping of CSS properties to values. For example the column span can be set to 2 with style={“grid-column-end”: “span 2”}.
Usually obtained via :py:meth:`axivion.dashboard.visualization.output.Output.grid`
- Parameters:
out (
typing.TextIO)indentation_level (
int)columns (
int)cache_config (
typing.Optional[axivion.dashboard.visualization.cache_config.CacheConfig])
- plain_text(style=None)¶
- Parameters:
style (
typing.Optional[typing.Mapping[str,str]])- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.PlainText]
- markdown(style=None)¶
- Parameters:
style (
typing.Optional[typing.Mapping[str,str]])- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.Markdown]
- svg(style=None)¶
- Parameters:
style (
typing.Optional[typing.Mapping[str,str]])- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.SVG]
- vega(style=None)¶
- Parameters:
style (
typing.Optional[typing.Mapping[str,str]])- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.Vega]
- table(options=None, style=None)¶
Starts a table widget.
- Parameters:
options (
typing.Optional[typing.Mapping[str,typing.Any]]) – seeTableOptionsstyle (
typing.Optional[typing.Mapping[str,str]])
- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.Table]
- grid(*, columns, style=None)¶
- Parameters:
columns (
int)style (
typing.Optional[typing.Mapping[str,str]])
- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.Grid]
Markdown¶
- class axivion.dashboard.visualization.output.Markdown(out, indentation_level, cache_config=None)¶
Bases:
CloseableWidget that renders the given Markdown string. More specifically CommonMark is expected, see https://commonmark.org for more details. Images are not supported.
Usually obtained via :py:meth:`axivion.dashboard.visualization.output.Output.markdown`
- Parameters:
out (
typing.TextIO)indentation_level (
int)cache_config (
typing.Optional[axivion.dashboard.visualization.cache_config.CacheConfig])
- write(part)¶
Appends the given markdown to the widget.
Initially, the widget is empty.
- Parameters:
part (
str) – the markdown snippet to append- Return type:
None
Output¶
- class axivion.dashboard.visualization.output.Output(out, cache_config)¶
Bases:
objectRoot widget container.
Allows only one child.
Usually obtained via :py:meth:`axivion.dashboard.visualization.VisualizationContext.output`
- Parameters:
out (
typing.TextIO)cache_config (
typing.Optional[axivion.dashboard.visualization.cache_config.CacheConfig])
- plain_text()¶
- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.PlainText]
- markdown()¶
- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.Markdown]
- svg()¶
- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.SVG]
- vega()¶
- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.Vega]
- table(options=None)¶
- Parameters:
options (
typing.Optional[typing.Mapping[str,typing.Any]])- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.Table]
- grid(*, columns)¶
- Parameters:
columns (
int)- Return type:
typing.ContextManager[axivion.dashboard.visualization.output.Grid]
PlainText¶
- class axivion.dashboard.visualization.output.PlainText(out, indentation_level, cache_config=None)¶
Bases:
CloseableWidget that outputs plain text - without any formatting.
Usually obtained via :py:meth:`axivion.dashboard.visualization.output.Output.plain_text`
- Parameters:
out (
typing.TextIO)indentation_level (
int)cache_config (
typing.Optional[axivion.dashboard.visualization.cache_config.CacheConfig])
- write(part)¶
Appends the given text to the widget text.
Initially, the widget text is the empty string.
- Parameters:
part (
str) – the text snippet to append- Return type:
None
SVG¶
- class axivion.dashboard.visualization.output.SVG(out, indentation_level, cache_config=None)¶
Bases:
CloseableWidget that outputs SVG.
Usually obtained via :py:meth:`axivion.dashboard.visualization.output.Output.svg`
- Parameters:
out (
typing.TextIO)indentation_level (
int)cache_config (
typing.Optional[axivion.dashboard.visualization.cache_config.CacheConfig])
- write_xml(svg_xml)¶
Writes the given SVG document into the widget.
If the XML document specifies an encoding, it has to be UTF-8.
- Parameters:
svg_xml (
str) – expected to contain a complete svg+xml document- Return type:
None
Table¶
- class axivion.dashboard.visualization.output.Table(out, indentation_level, options, cache_config=None)¶
Bases:
CloseableWidget that outputs tabular data.
Usually obtained via :py:meth:`axivion.dashboard.visualization.output.Output.table`
- Parameters:
out (
typing.TextIO)indentation_level (
int)options (
typing.Mapping[str,typing.Any])cache_config (
typing.Optional[axivion.dashboard.visualization.cache_config.CacheConfig])
- columns(columns)¶
Writes the descriptions of the tables columns.
- Parameters:
columns (
typing.List[typing.Mapping[str,typing.Any]]) – A list ofColumnInfoobjects.
The width of a column normally refers to a pixel count, but it is possible to get a percentage-based layout by specifying values less than 1. In that case, column resizing will be disabled.
Example:
[ { "key": "id", "type": "string", "linkKey": "id_link", "canFilter": true, "canSort": true, "showByDefault": true, "alignment": "left", "width": 0.75 }, { "key": "count", "type": "number", "canFilter": false, "canSort": true, "showByDefault": true, "alignment": "right", "width": 0.25 } ]
- rows(rows)¶
Writes the data content of the table.
- Parameters:
rows (
typing.Iterable[typing.Dict[str,typing.Any]]) – A list of objects that match the description of the previously written columns.
Example:
[ { "id": "json", "id_link": "https://www.json.org/", "count": 4 }, { "id": "internal", "id_link": "/url/relative/to/dashboard/basepath", "count": 8 } ]
Vega¶
- class axivion.dashboard.visualization.output.Vega(out, indentation_level, cache_config=None)¶
Bases:
CloseableWidget that outputs Vega JSON.
Usually obtained via :py:meth:`axivion.dashboard.visualization.output.Output.vega`
- Parameters:
out (
typing.TextIO)indentation_level (
int)cache_config (
typing.Optional[axivion.dashboard.visualization.cache_config.CacheConfig])
- write_json(vega_json)¶
Writes the given Vega JSON object into the widget.
- Parameters:
vega_json (
str) – expected to contain a complete vega json object- Return type:
None