Join the SIG TFX-Addons community and help make TFX even better!

Module: tfx.orchestration.experimental.interactive.notebook_formatters

TFX IPython notebook formatter integration.

Classes

class NotebookFormatter: Formats a TFX component in the context of an interactive notebook.

Functions

register_formatters(...): Register HTML notebook formatters for TFX classes.

FORMATTER_REGISTRY

{
 <class 'tfx.dsl.components.base.base_component.BaseComponent'>: <tfx.orchestration.experimental.interactive.notebook_formatters.NotebookFormatter object at 0x7f2e52ababd0>,
 <class 'tfx.orchestration.experimental.interactive.execution_result.ExecutionResult'>: <tfx.orchestration.experimental.interactive.notebook_formatters.NotebookFormatter object at 0x7f2e52abac90>,
 <class 'tfx.types.artifact.Artifact'>: <tfx.orchestration.experimental.interactive.notebook_formatters.NotebookFormatter object at 0x7f2e52aba8d0>,
 <class 'tfx.types.channel.Channel'>: <tfx.orchestration.experimental.interactive.notebook_formatters.NotebookFormatter object at 0x7f2e52abac50>
}

STATIC_HTML_CONTENTS ('<style>\n' '.tfx-object.expanded {\n' ' padding: 4px 8px 4px 8px;\n' ' background: white;\n' ' border: 1px solid #bbbbbb;\n' ' box-shadow: 4px 4px 2px rgba(0,0,0,0.05);\n' '}\n' '.tfx-object, .tfx-object * {\n' ' font-size: 11pt;\n' '}\n' '.tfx-object > .title {\n' ' cursor: pointer;\n' '}\n' '.tfx-object .expansion-marker {\n' ' color: #999999;\n' '}\n' '.tfx-object.expanded > .title > .expansion-marker:before {\n' " content: '▼';\n" '}\n' '.tfx-object.collapsed > .title > .expansion-marker:before {\n' " content: '▶';\n" '}\n' '.tfx-object .class-name {\n' ' font-weight: bold;\n' '}\n' '.tfx-object .deemphasize {\n' ' opacity: 0.5;\n' '}\n' '.tfx-object.collapsed > table.attr-table {\n' ' display: none;\n' '}\n' '.tfx-object.expanded > table.attr-table {\n' ' display: block;\n' '}\n' '.tfx-object table.attr-table {\n' ' border: 2px solid white;\n' ' margin-top: 5px;\n' '}\n' '.tfx-object table.attr-table td.attr-name {\n' ' vertical-align: top;\n' ' font-weight: bold;\n' '}\n' '.tfx-object table.attr-table td.attrvalue {\n' ' text-align: left;\n' '}\n' '</style>\n' '<script>\n' 'function toggleTfxObject(element) {\n' ' var objElement = element.parentElement;\n' " if (objElement.classList.contains('collapsed')) {\n" " objElement.classList.remove('collapsed');\n" " objElement.classList.add('expanded');\n" ' } else {\n' " objElement.classList.add('collapsed');\n" " objElement.classList.remove('expanded');\n" ' }\n' '}\n' '</script>\n')