docstr: Display a chart using the Altair library.
  
  Parameters
  ----------
  altair_chart : altair.Chart
      The Altair chart object to display.
  
  use_container_width : bool
      If True, set the chart width to the column width. This takes
      precedence over Altair's native ``width`` value.
  
  theme : "streamlit" or None
      The theme of the chart. Currently, we only support "streamlit" for the Streamlit
      defined design or None to fallback to the default behavior of the library.
  
  Example
  -------
  
  >>> import streamlit as st
  >>> import pandas as pd
  >>> import numpy as np
  >>> import altair as alt
  >>>
  >>> chart_data = pd.DataFrame(np.random.randn(20, 3), columns=["a", "b", "c"])
  >>>
  >>> c = (
  ...    alt.Chart(chart_data)
  ...    .mark_circle()
  ...    .encode(x="a", y="b", size="c", color="c", tooltip=["a", "b", "c"])
  ... )
  >>>
  >>> st.altair_chart(c, use_container_width=True)
  
  .. output::
     https://doc-vega-lite-chart.streamlit.app/
     height: 300px
  
  Examples of Altair charts can be found at
  https://altair-viz.github.io/gallery/.
docstr_tok: ["Display","a","chart","using","the","Altair","library",".","Parameters","--","--","--","--","--","altair_chart",":","altair.Chart","The","Altair","chart","object","to","display",".","use_container_width",":","bool","If","True",",","set","the","chart","width","to","the","column","width",".","This","takes","precedence","over","Altair","'s","native","``","width","``","value",".","theme",":","``","streamlit","''","or","None","The","theme","of","the","chart",".","Currently",",","we","only","support","``","streamlit","''","for","the","Streamlit","defined","design","or","None","to","fallback","to","the","default","behavior","of","the","library",".","Example","--","--","--","-",">",">",">","import","streamlit","as","st",">",">",">","import","pandas","as","pd",">",">",">","import","numpy","as","np",">",">",">","import","altair","as","alt",">",">",">",">",">",">","chart_data","=","pd.DataFrame","(","np.random.randn","(","20",",","3",")",",","columns=","[","``","a","''",",","``","b","''",",","``","c","''","]",")",">",">",">",">",">",">","c","=","(","...","alt.Chart","(","chart_data",")","...",".mark_circle","(",")","...",".encode","(","x=","''","a","''",",","y=","''","b","''",",","size=","''","c","''",",","color=","''","c","''",",","tooltip=","[","``","a","''",",","``","b","''",",","``","c","''","]",")","...",")",">",">",">",">",">",">","st.altair_chart","(","c",",","use_container_width=True",")","..","output",":",":","https",":","\/\/doc-vega-lite-chart.streamlit.app\/","height",":","300px","Examples","of","Altair","charts","can","be","found","at","https",":","\/\/altair-viz.github.io\/gallery\/","."]
code: def altair_chart(
      self,
      altair_chart: alt.Chart,
      use_container_width: bool = False,
      theme: Literal["streamlit"] | None = "streamlit",
  ) -> DeltaGenerator:
      """Display a chart using the Altair library.
  
      Parameters
      ----------
      altair_chart : altair.Chart
          The Altair chart object to display.
  
      use_container_width : bool
          If True, set the chart width to the column width. This takes
          precedence over Altair's native ``width`` value.
  
      theme : "streamlit" or None
          The theme of the chart. Currently, we only support "streamlit" for the Streamlit
          defined design or None to fallback to the default behavior of the library.
  
      Example
      -------
  
      >>> import streamlit as st
      >>> import pandas as pd
      >>> import numpy as np
      >>> import altair as alt
      >>>
      >>> chart_data = pd.DataFrame(np.random.randn(20, 3), columns=["a", "b", "c"])
      >>>
      >>> c = (
      ...    alt.Chart(chart_data)
      ...    .mark_circle()
      ...    .encode(x="a", y="b", size="c", color="c", tooltip=["a", "b", "c"])
      ... )
      >>>
      >>> st.altair_chart(c, use_container_width=True)
  
      .. output::
         https://doc-vega-lite-chart.streamlit.app/
         height: 300px
  
      Examples of Altair charts can be found at
      https://altair-viz.github.io/gallery/.
  
      """
      if theme != "streamlit" and theme != None:
          raise StreamlitAPIException(
              f'You set theme="{theme}" while Streamlit charts only support theme=”streamlit” or theme=None to fallback to the default library theme.'
          )
      proto = ArrowVegaLiteChartProto()
      marshall(
          proto,
          altair_chart,
          use_container_width=use_container_width,
          theme=theme,
      )
  
      return self.dg._enqueue("arrow_vega_lite_chart", proto)
  
imports: from __future__ import annotations
  from contextlib import nullcontext
  from datetime import date
  from enum import Enum
  from typing import TYPE_CHECKING, Any, Collection, Dict, List, Sequence, Tuple, cast
  import pandas
  from pandas.api.types import infer_dtype, is_integer_dtype
  from typing_extensions import Literal
  import streamlit.elements.arrow_vega_lite
  from streamlit import type_util
  from streamlit.color_util import Color, is_color_like, is_color_tuple_like, is_hex_color_like, to_css_color
  from streamlit.elements.altair_utils import AddRowsMetadata
  from streamlit.elements.arrow import Data
  from streamlit.elements.utils import last_index_for_melted_dataframes
  from streamlit.errors import Error, StreamlitAPIException
  from streamlit.proto.ArrowVegaLiteChart_pb2 import ArrowVegaLiteChart
  from streamlit.runtime.metrics_util import gather_metrics
label_desc: Use image node_id 5 for calling the ArrowAltairMixin obj's underlying member method code with example usage: obj.altair_chart(altair_chart, use_container_width, theme) and returns: self