code: def get_custom_term_info_js_function(
      plot_df,
      term_description_column_names,
      term_description_columns,
      term_word_in_term_description,
  ):
      custom_term_html = ""
      term_description_column_names = (
          {}
          if term_description_column_names is None
          else term_description_column_names
      )
      for col in term_description_columns:
          assert col in plot_df
          formatting = (
              ".toFixed(6)"
              if pd.api.types.is_float(plot_df[col].iloc[0])
              else ""
          )
          custom_term_html += (
              '+ "<b>%s:</b> " + d.etc["%s"]%s + "<br />"'
              % (
                  html.escape(
                      term_description_column_names.get(col, col)
                  ),
                  col.replace('"', '\\"').replace("'", "\\'"),
                  formatting,
              )
          )
      if custom_term_html != "":
          custom_term_html += "+"
      custom_term_info_js_function = (
          '(d => "%s: "+d.term+"<div class=topic_preview>"%s"</div>")'
          % (term_word_in_term_description, custom_term_html)
      )
      return custom_term_info_js_function
  
label_desc: Use image node_id 2 for calling a global function with example usage: get_custom_term_info_js_function(plot_df, term_description_column_names, term_description_columns, term_word_in_term_description) and returns: custom_term_info_js_function