code: def plot_predict_hierarchical_importance(
      dendrogram_hierarchical_correlation,
      hierarchical_importance_data,
      rounding_function,
      digits,
      absolute_value,
      type,
  ):
      dendrogram_hierarchical_importance = go.Figure(
          dendrogram_hierarchical_correlation
      )
      importance_dict = {}
      min_imp = min(hierarchical_importance_data["importance"])
      max_imp = max(hierarchical_importance_data["importance"])
  
      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 scatter in 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[:-1].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["importance"]
              if absolute_value:
                  imp_scatter = abs(imp_scatter)
              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_aspect(
                  row, rounding_function, digits
              )
  
              scatter_clustering.hoverinfo = "text"
              scatter_clustering.hoverlabel = {
                  "bgcolor": "rgba(0,0,0,0.8)"
              }
              scatter_clustering.hovertext = tooltip_text_aspect(
                  row, rounding_function, digits
              )
  
      for i, scatter in enumerate(
          dendrogram_hierarchical_importance.data
      ):
          vars_before = aspects_vars_before[i]
          if i not in updated:
              if absolute_value == True:
                  imp_scatter = abs(
                      hierarchical_importance_data.iloc[-1][
                          "importance"
                      ]
                  )
              else:
                  imp_scatter = hierarchical_importance_data.iloc[-1][
                      "importance"
                  ]
              change_last = True if type == "default" else False
              scatter.hoverinfo = "text"
              scatter.hoverlabel = {"bgcolor": "rgba(0,0,0,0.8)"}
              scatter.hovertext = tooltip_text_aspect(
                  hierarchical_importance_data.iloc[-1],
                  rounding_function,
                  digits,
                  change_last,
              )
              scatter_clustering = (
                  dendrogram_hierarchical_correlation.data[i]
              )
              scatter_clustering.hoverinfo = "text"
              scatter_clustering.hoverlabel = {
                  "bgcolor": "rgba(0,0,0,0.8)"
              }
              scatter_clustering.hovertext = tooltip_text_aspect(
                  hierarchical_importance_data.iloc[-1],
                  rounding_function,
                  digits,
                  change_last,
              )
              scatter.x[1:3] = imp_scatter
              importance_dict[
                  tuple(aspects_dendro_order[i])
              ] = imp_scatter
          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])]
  
      min_range = min_imp * 1.15 if min_imp < 0 else min_imp * 0.85
      max_range = (
          max_imp * 1.15 if max_imp * 1.15 > 0 else max_imp * 0.85
      )
      dendrogram_hierarchical_importance.update_xaxes(
          range=[min_range, max_range],
          visible=False,
          showticklabels=False,
      )
      return dendrogram_hierarchical_importance, updated
  
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 1 for calling a global function with example usage: plot_predict_hierarchical_importance(dendrogram_hierarchical_correlation, hierarchical_importance_data, rounding_function, digits, absolute_value, type) and returns: dendrogram_hierarchical_importance,  updated