code: def plot_model_hierarchical_importance(
      dendrogram_hierarchical_correlation,
      hierarchical_importance_data,
      rounding_function,
      digits,
      change,
  ):
      dendrogram_hierarchical_importance = go.Figure(
          dendrogram_hierarchical_correlation
      )
      importance_dict = {}
      max_imp = (
          max(hierarchical_importance_data["dropout_loss_change"])
          if change
          else max(hierarchical_importance_data["dropout_loss"])
      )
  
      tick_dict = dict(
          zip(
              dendrogram_hierarchical_importance.layout.yaxis.tickvals,
              [
                  [var]
                  for var in dendrogram_hierarchical_importance.layout.yaxis.ticktext
              ],
          )
      )
      aspects_dendro_order = []
      aspects_vars_before = []
      for i, scatter in enumerate(
          dendrogram_hierarchical_importance.data
      ):
          tick_dict[np.mean(scatter.y[1:3])] = (
              tick_dict[scatter.y[1]] + tick_dict[scatter.y[2]]
          )
          aspects_dendro_order.append(
              tick_dict[scatter.y[1]] + tick_dict[scatter.y[2]]
          )
          aspects_vars_before.append(
              (tick_dict[scatter.y[1]], tick_dict[scatter.y[2]])
          )
  
      updated = []
      for i, row in hierarchical_importance_data.iterrows():
          dendro_mask = np.array(
              [
                  set(row.variable_names) == set(el)
                  for el in aspects_dendro_order
              ]
          )
          if dendro_mask.any():
              k = np.flatnonzero(dendro_mask == True)[0]
              updated.append(k)
              imp_scatter = (
                  row["dropout_loss_change"]
                  if change
                  else row["dropout_loss"]
              )
              scatter_importance = (
                  dendrogram_hierarchical_importance.data[k]
              )
              scatter_clustering = (
                  dendrogram_hierarchical_correlation.data[k]
              )
              importance_dict[
                  tuple(aspects_dendro_order[k])
              ] = imp_scatter
              scatter_importance.x[1:3] = imp_scatter
  
              scatter_importance.hoverinfo = "text"
              scatter_importance.hoverlabel = {
                  "bgcolor": "rgba(0,0,0,0.8)"
              }
              scatter_importance.hovertext = tooltip_text(
                  row, rounding_function, digits
              )
  
              scatter_clustering.hoverinfo = "text"
              scatter_clustering.hoverlabel = {
                  "bgcolor": "rgba(0,0,0,0.8)"
              }
              scatter_clustering.hovertext = tooltip_text(
                  row, rounding_function, digits
              )
  
      for i, scatter in enumerate(
          dendrogram_hierarchical_importance.data
      ):
          vars_before = aspects_vars_before[i]
          if i not in updated:
              scatter.x[1:3] = max_imp
              importance_dict[tuple(aspects_dendro_order[i])] = max_imp
          if tuple(vars_before[0]) in importance_dict.keys():
              scatter.x[0] = importance_dict[tuple(vars_before[0])]
          if tuple(vars_before[1]) in importance_dict.keys():
              scatter.x[3] = importance_dict[tuple(vars_before[1])]
  
      dendrogram_hierarchical_importance.update_xaxes(
          range=[
              0,
              max(hierarchical_importance_data["dropout_loss_change"])
              * 1.05,
          ]
          if change
          else [
              0,
              max(hierarchical_importance_data["dropout_loss"]) * 1.05,
          ],
          visible=False,
          showticklabels=False,
      )
      return dendrogram_hierarchical_importance, updated
  
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 1 for calling a global function with example usage: plot_model_hierarchical_importance(dendrogram_hierarchical_correlation, hierarchical_importance_data, rounding_function, digits, change) and returns: dendrogram_hierarchical_importance,  updated