code: def get_tooltip_js_function(
      plot_df, tooltip_column_names, tooltip_columns
  ):
      if len(tooltip_columns) > 2:
          raise Exception(
              "You can have at most two columns in a tooltip."
          )
      tooltip_content = ""
      tooltip_column_names = (
          {} if tooltip_column_names is None else tooltip_column_names
      )
      for col in tooltip_columns:
          assert col in plot_df
          formatting = ""
          if pd.api.types.is_float(plot_df[col].iloc[0]):
              formatting = ".toFixed(6)"
          tooltip_content += '+ "<br />%s: " + d.etc["%s"]%s' % (
              html.escape(tooltip_column_names.get(col, col)),
              col.replace('"', '\\"').replace("'", "\\'"),
              formatting,
          )
      tooltip_content_js_function = (
          "(function(d) {return d.term %s;})" % tooltip_content
      )
      return tooltip_content_js_function
  
label_desc: Use image node_id 1 for calling a global function with example usage: get_tooltip_js_function(plot_df, tooltip_column_names, tooltip_columns) and returns: tooltip_content_js_function