docstr: Parameters
  ----------
  protocol : str
   'http' or 'https' for including external urls
  d3_url, str
    None by default.  The url (or path) of
    d3, to be inserted into <script src="..."/>
    By default, this is `DEFAULT_D3_URL` declared in `ScatterplotStructure`.
  d3_scale_chromatic_url : str
    None by default.
    URL of d3_scale_chromatic_url, to be inserted into <script src="..."/>
    By default, this is `DEFAULT_D3_SCALE_CHROMATIC` declared in `ScatterplotStructure`.
  html_base : str
      None by default.  HTML of semiotic square to be inserted above plot.
  search_input_id : str
      Id of search input. Default is 'searchInput'.
  Returns
  -------
  str, the html file representation
docstr_tok: ["Parameters","--","--","--","--","--","protocol",":","str","'http","'","or","'https","'","for","including","external","urls","d3_url",",","str","None","by","default",".","The","url","(","or","path",")","of","d3",",","to","be","inserted","into","<","script","src=","''","...","''","\/",">","By","default",",","this","is","`","DEFAULT_D3_URL","`","declared","in","`","ScatterplotStructure","`",".","d3_scale_chromatic_url",":","str","None","by","default",".","URL","of","d3_scale_chromatic_url",",","to","be","inserted","into","<","script","src=","''","...","''","\/",">","By","default",",","this","is","`","DEFAULT_D3_SCALE_CHROMATIC","`","declared","in","`","ScatterplotStructure","`",".","html_base",":","str","None","by","default",".","HTML","of","semiotic","square","to","be","inserted","above","plot",".","search_input_id",":","str","Id","of","search","input",".","Default","is","'searchInput","'",".","Returns","--","--","--","-","str",",","the","html","file","representation"]
code: def to_html(
      self,
      protocol="http",
      d3_url=None,
      d3_scale_chromatic_url=None,
      html_base=None,
      search_input_id="searchInput",
  ):
      """
      Parameters
      ----------
      protocol : str
       'http' or 'https' for including external urls
      d3_url, str
        None by default.  The url (or path) of
        d3, to be inserted into <script src="..."/>
        By default, this is `DEFAULT_D3_URL` declared in `ScatterplotStructure`.
      d3_scale_chromatic_url : str
        None by default.
        URL of d3_scale_chromatic_url, to be inserted into <script src="..."/>
        By default, this is `DEFAULT_D3_SCALE_CHROMATIC` declared in `ScatterplotStructure`.
      html_base : str
          None by default.  HTML of semiotic square to be inserted above plot.
      search_input_id : str
          Id of search input. Default is 'searchInput'.
      Returns
      -------
      str, the html file representation
  
      """
      d3_url_struct = D3URLs(d3_url, d3_scale_chromatic_url)
      ExternalJSUtilts.ensure_valid_protocol(protocol)
      javascript_to_insert = "\n".join(
          [
              PackedDataUtils.full_content_of_javascript_files(),
              self.scatterplot_structure._visualization_data.to_javascript(),
              self.scatterplot_structure.get_js_to_call_build_scatterplot(),
              PackedDataUtils.javascript_post_build_viz(
                  search_input_id, "plotInterface"
              ),
          ]
      )
      html_template = (
          PackedDataUtils.full_content_of_default_html_template()
          if html_base is None
          else self._format_html_base(html_base)
      )
      html_content = (
          html_template.replace(
              "<!-- INSERT SCRIPT -->", javascript_to_insert, 1
          )
          .replace(
              "<!-- INSERT SEARCH FORM -->",
              PackedDataUtils.full_content_of_default_search_form(
                  search_input_id
              ),
              1,
          )
          .replace("<!--D3URL-->", d3_url_struct.get_d3_url(), 1)
          .replace(
              "<!--D3SCALECHROMATIC-->",
              d3_url_struct.get_d3_scale_chromatic_url(),
          )
          # .replace('<!-- INSERT D3 -->', self._get_packaged_file_content('d3.min.js'), 1)
      )
  
      """
          if html_base is not None:
              html_file = html_file.replace('<!-- INSERT SEMIOTIC SQUARE -->',
                                            html_base)
          """
  
      extra_libs = ""
      if self.scatterplot_structure._save_svg_button:
          # extra_libs = '<script src="https://cdn.rawgit.com/edeno/d3-save-svg/gh-pages/assets/d3-save-svg.min.js" charset="utf-8"></script>'
          extra_libs = ""
  
      autocomplete_css = (
          PackedDataUtils.full_content_of_default_autocomplete_css()
      )
      html_content = (
          html_content.replace(
              "/***AUTOCOMPLETE CSS***/", autocomplete_css, 1
          )
          .replace("<!-- EXTRA LIBS -->", extra_libs, 1)
          .replace("http://", protocol + "://")
      )
  
      return html_content
  
imports: import pkgutil
  from typing import Tuple
  from scattertext.Common import DEFAULT_D3_URL, DEFAULT_D3_SCALE_CHROMATIC, DEFAULT_HTML_VIZ_FILE_NAME, AUTOCOMPLETE_CSS_FILE_NAME, SEARCH_FORM_FILE_NAME
  from scattertext.viz.ScatterplotStructure import InvalidProtocolException
label_desc: Use image node_id 2 for calling the BasicHTMLFromScatterplotStructure obj's underlying member method code with example usage: obj.to_html(protocol, d3_url, d3_scale_chromatic_url, html_base, search_input_id) and returns: html_content