docstr: Export scene to HTML as StringIO buffer.
docstr_tok: ["Export","scene","to","HTML","as","StringIO","buffer","."]
code: def export_html(self):
      """Export scene to HTML as StringIO buffer."""
      content = io.StringIO()
      if isinstance(self, PyVistaLocalView):
          data = self.export(format="zip")
          if data is None:
              raise ValueError("No data to write.")
          write_html(data, content)
          content.seek(0)
      elif isinstance(self, PyVistaRemoteLocalView):
          data = self.export_geometry(format="zip")
          if data is None:
              raise ValueError("No data to write.")
          write_html(data, content)
          content.seek(0)
      else:
          content = self._plotter().export_html(filename=None)
      return io.BytesIO(content.read().encode("utf8")).read()
  
imports: import io
  import weakref
  from trame.app import get_server
  from trame.widgets.vtk import VtkLocalView, VtkRemoteLocalView, VtkRemoteView
  from trame_vtk.tools.vtksz2html import write_html
label_desc: Use image node_id 5 for calling the _BasePyVistaView obj's underlying member method code with example usage: obj.export_html() and returns: io