TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

Module: tfx.orchestration.interactive.notebook_formatters

View source on GitHub

TFX IPython notebook formatter integration.


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


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

Other Members

  • 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>\nfunction 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"