class_docstr: Formats a TFX component in the context of an interactive notebook.
class_docstr_tok: ["Formats","a","TFX","component","in","the","context","of","an","interactive","notebook","."]
docstr: 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.
docstr_tok: ["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","."]
code: def render(
      self,
      obj: Any,
      expanded: bool = True,
      seen_elements: Optional[Set[Any]] = None,
  ) -> str:
      """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.
      """
      seen_elements = seen_elements or set()
      if id(obj) in seen_elements:
          return "(recursion in rendering object)"
      seen_elements.add(id(obj))
      if not isinstance(obj, self.cls):
          raise ValueError(
              "Expected object of type %s but got %s." % (self.cls, obj)
          )
      seen_elements.remove(id(obj))
      return STATIC_HTML_CONTENTS + (
          '<div class="tfx-object%s">'
          '<div class = "title" onclick="toggleTfxObject(this)">'
          '<span class="expansion-marker"></span>'
          '%s<span class="deemphasize"> at 0x%x</span></div>%s'
          "</div>"
      ) % (
          " expanded" if expanded else " collapsed",
          self.render_title(obj),
          id(obj),
          self.render_attributes(obj, seen_elements),
      )
  
file_path: tfx/tfx/orchestration/experimental/interactive/notebook_formatters.py
imports: import builtins
  import html
  from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
  from tfx.dsl.components.base.base_component import BaseComponent
  from tfx.orchestration.experimental.interactive.execution_result import ExecutionResult
  from tfx.types.artifact import Artifact
  from tfx.types.channel import Channel
label_desc: Use image node_id 3 for calling the NotebookFormatter obj's underlying member method code with example usage: obj.render(obj, expanded, seen_elements) and returns: unknown, str