code: def add_text_to_dendrogram(
      fig,
      updated_dendro_traces,
      rounding_function,
      digits,
      type="clustering",
  ):
      res_fig = go.Figure(fig)
      for i, scatter in enumerate(res_fig.data):
          if i in updated_dendro_traces:
              x_cord = scatter.x[1]
              y_cord = np.mean(scatter.y[1:3])
              if type == "clustering":
                  lab_text = str(rounding_function(1 - x_cord, digits))
              else:
                  lab_text = str(rounding_function(x_cord, digits))
              scatter.x = np.insert(scatter.x, 2, x_cord)
              scatter.y = np.insert(scatter.y, 2, y_cord)
              scatter.mode = "text+lines"
              scatter["text"] = [None, None, lab_text, None, None]
              scatter["textposition"] = "middle left"
      return res_fig
  
file_path: DALEX/python/dalex/dalex/aspect/_model_triplot/plot.py
imports: import numpy
  import plotly.graph_objects
  from copy import deepcopy
  from dalex import _theme, _global_utils
label_desc: Use image node_id 6 for calling a global function with example usage: add_text_to_dendrogram(fig, updated_dendro_traces, rounding_function, digits, type) and returns: res_fig