docstr: Draw information of field value distribution for categorical type to
  the report.
  
  Args:
      notes(str): Explain the block
      field_name (str): data field name
      field_distribution (:dict of :CategoricalStats):
          -key: label_name
          -value: frequency distribution under the `label_name`(dict)
              - key: field value
              - value: CategoricalStats object
      max_values_display (int): maximum number of values displayed
      colors (list): the list of color code for rendering different class
code: def draw_categorical_field_distribution(
      self,
      notes: str,
      *,
      field_name: str,
      field_distribution: Dict[str, CategoricalStats],
      max_values_display=20,
      colors=None,
  ):
      """
      Draw information of field value distribution for categorical type to
      the report.
  
      Args:
          notes(str): Explain the block
          field_name (str): data field name
          field_distribution (:dict of :CategoricalStats):
              -key: label_name
              -value: frequency distribution under the `label_name`(dict)
                  - key: field value
                  - value: CategoricalStats object
          max_values_display (int): maximum number of values displayed
          colors (list): the list of color code for rendering different class
      """
      from xai.graphs import graph_generator
  
      if colors is None:
          colors = [
              "Blues_d",
              "Reds_d",
              "Greens_d",
              "Purples_d",
              "Oranges_d",
          ]
      # -- Draw Content --
      self.html.article[-1].items.append(
          self.html.add_paragraph(text=notes)
      )
      for idx, (label_name, cat_stats) in enumerate(
          field_distribution.items()
      ):
          frequency_distribution = cat_stats.frequency_count
          title = "For %s samples" % label_name
          self.html.article[-1].items.append(
              self.html.add_header(text=title, heading="h5")
          )
          if (
              len(frequency_distribution)
              / sum(frequency_distribution.values())
              > 0.5
          ):
              self.html.article[-1].items.append(
                  self.html.add_paragraph(
                      text="Warning: %s unique values found in %s samples."
                      % (
                          len(frequency_distribution),
                          sum(frequency_distribution.values()),
                      )
                  ),
                  style="BI",
              )
              break
  
          if len(field_distribution) > max_values_display:
              self.html.article[-1].items.append(
                  self.html.add_paragraph(
                      text="%s of %s are displayed)"
                      % (max_values_display, len(field_distribution))
                  )
              )
  
          figure_path = "%s/%s_%s_field_distribution.png" % (
              self.figure_path,
              field_name,
              label_name,
          )
          image_path = graph_generator.BarPlot(
              file_path=figure_path,
              data=frequency_distribution,
              title=title,
              x_label="",
              y_label=field_name,
          ).draw(
              limit_length=max_values_display,
              color_palette=colors[idx % len(colors)],
          )
          self.html.article[-1].items.append(
              self.html.add_image(src=image_path, alt=title)
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import os
  import tempfile
  import warnings
  import shutil
  from typing import Tuple, Dict, List
  import numpy
  from xai import MODE
  from xai.data.explorer import CategoricalStats, NumericalStats, TextStats, DatetimeStats
  from xai.formatter.contents import Header, Title, SectionTitle
  from xai.formatter.hypertext_markup.publisher import CustomHtml, Div
  from xai.formatter.report.section import OverviewSection, DetailSection
  from xai.formatter.writer import Writer
label_desc: Use image node_id 21 for calling the HtmlWriter obj's underlying member method code with example usage: obj.draw_categorical_field_distribution(notes) without return types