code: def get_disparity_bubble_chart_components(
      plot_table,
      metrics,
      ref_group,
      global_scales,
      selection,
      fairness_threshold,
      chart_height,
      chart_width,
      accessibility_mode=False,
      concat_chart=False,
  ):
      """Creates the components necessary to plot the disparity chart."""
  
      # Check for warnings in plot
      metric_warnings = []
      # COMPUTE SCALED DISPARITIES
      for metric in metrics:
          zero_metric_groups = plot_table[
              plot_table[f"{metric}_disparity"] == 0
          ]
          zero_values = zero_metric_groups["attribute_value"].values
          if zero_values.any():
              metric_warnings.append([zero_values, metric])
  
          plot_table[f"{metric}_disparity_scaled"] = plot_table.apply(
              lambda row: transform_ratio(row[f"{metric}_disparity"]),
              axis=1,
          )
  
      # POSITION SCALES
      position_scales = __get_position_scales(
          plot_table,
          metrics,
          fairness_threshold,
          chart_height,
          chart_width,
      )
  
      scales = dict(global_scales, **position_scales)
  
      # RULES
      horizontal_rules = __draw_metrics_rules(
          metrics, scales, concat_chart
      )
      reference_rule = __draw_reference_rule(
          ref_group, chart_height, chart_width
      )
  
      # LABELS
      x_ticks_labels = __draw_x_ticks_labels(scales, chart_height)
  
      # ANNOTATIONS
      text_annotations = __draw_text_annotations(
          ref_group, chart_height, scales["x"].range
      )
  
      # BUBBLES - CENTERS & AREAS
      bubbles = __draw_bubbles(
          plot_table,
          metrics,
          ref_group,
          scales,
          selection,
      )
  
      # THRESHOLD & BANDS
      if fairness_threshold is not None:
          threshold_elements = __get_threshold_elements(
              fairness_threshold,
              ref_group,
              scales,
              chart_height,
              chart_width,
              accessibility_mode,
              metric_warnings,
          )
  
          # ASSEMBLE CHART WITH THRESHOLD
          main_chart = (
              horizontal_rules
              + reference_rule
              + x_ticks_labels
              + text_annotations
              + threshold_elements
              + bubbles
          )
  
      # ASSEMBLE CHART WITHOUT THRESHOLD
      else:
          main_chart = (
              horizontal_rules
              + x_ticks_labels
              + text_annotations
              + reference_rule
              + bubbles
          )
  
      return main_chart
  
imports: import math
  import altair
  import pandas
  from aequitas.plot.commons.helpers import no_axis, transform_ratio, get_chart_metadata
  from aequitas.plot.commons.legend import draw_legend
  from aequitas.plot.commons.scales import get_chart_size_range
  from aequitas.plot.commons.tooltips import get_tooltip_text_group_size, get_tooltip_text_disparity_explanation
  from aequitas.plot.commons.style.classes import Metric_Axis, Axis, Annotation, Reference_Rule, Threshold_Rule, Threshold_Band, Bubble, Chart_Title
  from aequitas.plot.commons.style.text import FONT, FONT_SIZE_SMALL
  from aequitas.plot.commons.style.sizes import Disparity_Chart
  from aequitas.plot.commons import initializers
  from aequitas.plot.commons import labels
label_desc: Use image node_id 12 for calling a global function with example usage: get_disparity_bubble_chart_components(plot_table, metrics, ref_group, global_scales, selection, fairness_threshold, chart_height, chart_width, accessibility_mode, concat_chart) and returns: main_chart