code: def add_text_to_dendrogram(
      fig, updated, rounding_function, digits, type="clustering"
  ):
      res_fig = go.Figure(fig)
      corner_scatters = []
      for i, scatter in enumerate(res_fig.data):
          if i in updated:
              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"
          else:
              corner_scatters.append(scatter)
      if corner_scatters:
          scatter = corner_scatters[len(corner_scatters) // 2]
          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/_predict_triplot/plot.py
imports: import numpy
  import plotly.graph_objects
  from copy import deepcopy
  from dalex import _global_utils, _theme
  from .None import utils
label_desc: Use image node_id 5 for calling a global function with example usage: add_text_to_dendrogram(fig, updated, rounding_function, digits, type) and returns: res_fig