code: def chart_size_bubble(width, height, chart_sizes, num_metrics):
      """Given parameters width and height for the bubble charts and the number of metrics, this function checks if there is enough area to render all elements and if there is a sensible aspect ratio.
  
      :param width: chart width
      :type width: int
      :param height: chart height
      :type height: int
      :param chart_sizes: size style defaults for the chart
      :type chart_sizes: class
      :param num_metrics: number of metrics to be plotted
      :type num_metrics: int
      """
      min_height = calculate_chart_size_from_elements(
          chart_sizes.vertical_header_height,
          chart_sizes.min_line_height,
          num_metrics,
      )
  
      if width < chart_sizes.min_width:
          raise ValueError(
              f"The chart width must be at least {chart_sizes.min_width} to preserve a sensible aspect ratio."
          )
  
      if height < min_height:
          raise ValueError(
              f"The chart height must be at least {min_height} to accommodate the {num_metrics} metrics to be plotted."
          )
  
file_path: aequitas/src/aequitas/plot/commons/validators.py
imports: from aequitas.plot.commons.style import sizes
  from aequitas.plot.commons.helpers import calculate_chart_size_from_elements, to_list
label_desc: Use image node_id 6 for calling a global function with example usage: chart_size_bubble(width, height, chart_sizes, num_metrics) without return types