![]() |
Formats a TFX component in the context of an interactive notebook.
tfx.orchestration.experimental.interactive.notebook_formatters.NotebookFormatter(
cls: Type[object],
attributes: List[Text] = None,
title_format: Tuple[Text, List[Union[Text, Callable]]] = None,
_show_artifact_attributes: Optional[bool] = False
)
Args | |
---|---|
cls
|
The TFX class to be formated by this NotebookFormatter instance. |
attributes
|
A list of string attributes that are to be displayed by this
formatter. Can be a nested field specifier with nested attribute names
separated by "." (e.g. to get obj.a.b , specify the attribute string
"a.b").
|
title_format
|
A 2-tuple consisting of (1) a format string and (2) a list of either string attribute names (possible of nested field specifiers as in "attributes" above) or callback callable objects taking as input the object to be formatted and returning the value for that position of the format string. If not specified, the default title format will be used. |
_show_artifact_attributes
|
For a formatter of an Artifact object, show the Artifact type-specific properties for each artifact. |
Methods
render
render(
obj: object,
expanded: bool = True,
seen_elements: Optional[set] = None
) -> Text
Render a given object as an HTML string.
Args | |
---|---|
obj
|
The object to be rendered. |
expanded
|
Whether the object is to be expanded by default. |
seen_elements
|
Optionally, a set of seen elements to not re-render to prevent a rendering cycle. |
Returns | |
---|---|
Formatted HTML string representing the object, for notebook display. |
render_attributes
render_attributes(
obj: object,
seen_elements: set
) -> Text
Render the attributes section of an object.
render_dict
render_dict(
obj: dict,
seen_elements: set
) -> Text
Render a dictionary table.
render_list
render_list(
obj: list,
seen_elements: set
) -> Text
Render a list table.
render_title
render_title(
obj: object
) -> Text
Render the title section of an object.
render_value
render_value(
value: object,
seen_elements: set
) -> object
Render the value section of an object.