code: def __init__(
      self, dataframe_report, which_graph: str, association_data
  ):
      self.set_style(["graph_base.mplstyle"])
  
      # Set categories to use first (some may be unused but no need to optimize this)
      categoricals = [
          dataframe_report[feature]["name"]
          for feature in dataframe_report._features
          if dataframe_report[feature]["type"]
          in [FeatureType.TYPE_CAT, FeatureType.TYPE_BOOL]
      ]
      nums = [
          dataframe_report[feature]["name"]
          for feature in dataframe_report._features
          if dataframe_report[feature]["type"] == FeatureType.TYPE_NUM
      ]
      combined = [
          dataframe_report[feature]["name"]
          for feature in dataframe_report._features
          if dataframe_report[feature]["type"]
          in [
              FeatureType.TYPE_CAT,
              FeatureType.TYPE_BOOL,
              FeatureType.TYPE_NUM,
          ]
          and feature in association_data
      ]
      # Add target at beginning
      if (
          dataframe_report._target is not None
          and dataframe_report._target["name"] in association_data
      ):
          for list_of_features in [categoricals, nums, combined]:
              list_of_features.insert(
                  0, dataframe_report._target["name"]
              )
  
      if len(association_data) == 0 or len(combined) == 0:
          f, axs = plt.subplots(1, 1, figsize=(1, 1))
          self.graph_base64 = self.get_encoded_base64(f)
          plt.close(f)
          return
  
      # Build graph_data dataframe with the information we need for the type of graph we want
      if which_graph == "all":
          # ALL
          graph_data = make_zero_square_dataframe(combined)
  
          for feature in combined:
              for associated_feature_name in combined:
                  associated_feature_val = association_data[
                      feature
                  ].get(associated_feature_name)
                  if associated_feature_val is not None:
                      graph_data.at[
                          combined.index(feature),
                          associated_feature_name,
                      ] = associated_feature_val
          # Workaround
          graph_data[UNIQUE_INDEX_NAME] = combined
          graph_data.set_index(UNIQUE_INDEX_NAME, inplace=True)
          # matplotlib.use('tkagg')
          # corrplot(graph_data)
          # plt.show()
  
      elif which_graph == "cat-cat":
          # CATEGORY-CATEGORY
          # Associations: _associations[FEATURE][GIVES INFORMATION ABOUT THIS FEATURE]
          graph_data = make_zero_square_dataframe(categoricals)
  
          for feature in categoricals:
              for associated_feature_name in categoricals:
                  associated_feature_val = association_data[
                      feature
                  ].get(associated_feature_name)
                  if associated_feature_val is not None:
                      graph_data.at[
                          categoricals.index(feature),
                          associated_feature_name,
                      ] = associated_feature_val
          # Workaround
          graph_data["index"] = categoricals
          graph_data.set_index("index", inplace=True)
  
      elif which_graph == "num-num":
          # NUM-NUM
          graph_data = make_zero_square_dataframe(nums)
  
          for feature in nums:
              for associated_feature_name in nums:
                  associated_feature_val = association_data[
                      feature
                  ].get(associated_feature_name)
                  if associated_feature_val is not None:
                      # Make symmetrical, values in both
                      graph_data.at[
                          nums.index(feature), associated_feature_name
                      ] = associated_feature_val
                      graph_data.at[
                          nums.index(associated_feature_name), feature
                      ] = associated_feature_val
          # Workaround
          graph_data["index"] = nums
          graph_data.set_index("index", inplace=True)
  
      elif which_graph == "cat-num":
          # CAT-NUM
  
          # RECTANGULAR: rows are categories. Still, make a square, with categories first
          # (we will just not render the Unused rows/cols)
          graph_data = pd.DataFrame()
          # Add columns
          empty_row_dict = dict()
          for feature in nums:
              graph_data[feature] = pd.Series()
              empty_row_dict[feature] = 0.0
          if len(nums) > len(categoricals):
              for i in range(len(categoricals), len(nums)):
                  graph_data[str(i) + "PAD"] = pd.Series()
                  empty_row_dict[str(i) + "PAD"] = 0.0
  
          # Add series
          for categorical in categoricals:
              graph_data = graph_data.append(
                  pd.Series(empty_row_dict, name=categorical)
              )
          if len(categoricals) > len(nums):
              for i in range(len(nums), len(categoricals)):
                  graph_data = graph_data.append(
                      pd.Series(empty_row_dict, name=str(i) + "RPAD")
                  )
  
          # MUST DROP INDEX GRRRR
          orig_index = graph_data.index.values
          graph_data.reset_index(drop=True, inplace=True)
  
          for feature in categoricals:
              for associated_feature_name in nums:
                  associated_feature_val = association_data[
                      feature
                  ].get(associated_feature_name)
                  if associated_feature_val is not None:
                      graph_data.at[
                          categoricals.index(feature),
                          associated_feature_name,
                      ] = associated_feature_val
          # Workaround
          graph_data["index"] = orig_index
          graph_data.set_index("index", inplace=True)
  
      # Finalize Graph
      # plt.subplots_adjust(bottom=0.15, right=0.85, top=0.97, left=0.15)
      f = corrplot(graph_data, dataframe_report)
      self.graph_base64 = self.get_encoded_base64(f)
      plt.close(f)
      return
  
file_path: sweetviz/sweetviz/graph_associations.py
imports: import math
  import numpy
  import pandas
  import matplotlib.pyplot
  from sweetviz.sv_types import FeatureType
  import sweetviz.graph
  from sweetviz.config import config
  import itertools
  import matplotlib.patches
  from textwrap import wrap
label_desc: Use image node_id 1 to create a new GraphAssoc object from inherited base classes: sweetviz.graph with example: obj = GraphAssoc(dataframe_report, which_graph, association_data)