code: def chart_size_summary(size_constants, num_metrics, num_attributes):
      """Given sizing constants for the summary chart and the number of metrics and attributes, this function checks if there is enough area to render all elements and if there is a sensible aspect ratio.
  
      :param size_constants: size constants for Summary Chart size elements
      :type size_constants: dict
      :param num_metrics: number of metrics to be plotted (rows)
      :type num_metrics: int
      :param num_attributes: number of attributes to be plotted (columns)
      :type num_attributes: int
      """
  
      min_width = (
          Sizes.Summary_Chart.min_column_width
          * num_attributes
          / Sizes.Summary_Chart.column_width_ratio
      )
      max_width = (
          Sizes.Summary_Chart.max_column_width
          * num_attributes
          / Sizes.Summary_Chart.column_width_ratio
      )
      min_height = (
          Sizes.Summary_Chart.min_line_height * num_metrics / 0.65
      )
      max_height = (
          Sizes.Summary_Chart.max_line_height * num_metrics / 0.65
      )
  
      if (
          size_constants["column_width"]
          < Sizes.Summary_Chart.min_column_width
      ):
          raise ValueError(
              f"The chart width must be at least {min_width} to accommodate the {num_attributes} attributes to be plotted."
          )
  
      if (
          size_constants["column_width"]
          > Sizes.Summary_Chart.max_column_width
      ):
          raise ValueError(
              f"The chart width must be smaller than {max_width} to preserve a sensible aspect ratio."
          )
      if (
          size_constants["line_height"]
          < Sizes.Summary_Chart.min_line_height
      ):
          raise ValueError(
              f"The chart height must be at least {min_height} to accommodate the {num_metrics} metrics to be plotted."
          )
      if (
          size_constants["line_height"]
          > Sizes.Summary_Chart.max_line_height
      ):
          raise ValueError(
              f"The chart height must be smaller than {max_height} to preserve a sensible aspect ratio."
          )
  
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 5 for calling a global function with example usage: chart_size_summary(size_constants, num_metrics, num_attributes) without return types