docstr: Display a chart using the Vega-Lite library.
  
  Parameters
  ----------
  data : pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None
      Either the data to be plotted or a Vega-Lite spec containing the
      data (which more closely follows the Vega-Lite API).
  
  spec : dict or None
      The Vega-Lite spec for the chart. If the spec was already passed in
      the previous argument, this must be set to None. See
      https://vega.github.io/vega-lite/docs/ for more info.
  
  use_container_width : bool
      If True, set the chart width to the column width. This takes
      precedence over Vega-Lite'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.
  
  **kwargs : any
      Same as spec, but as keywords.
  
  Example
  -------
  >>> import streamlit as st
  >>> import pandas as pd
  >>> import numpy as np
  >>>
  >>> chart_data = pd.DataFrame(np.random.randn(200, 3), columns=["a", "b", "c"])
  >>>
  >>> st.vega_lite_chart(
  ...    chart_data,
  ...    {
  ...        "mark": {"type": "circle", "tooltip": True},
  ...        "encoding": {
  ...            "x": {"field": "a", "type": "quantitative"},
  ...            "y": {"field": "b", "type": "quantitative"},
  ...            "size": {"field": "c", "type": "quantitative"},
  ...            "color": {"field": "c", "type": "quantitative"},
  ...        },
  ...    },
  ... )
  
  .. output::
     https://doc-vega-lite-chart.streamlit.app/
     height: 300px
  
  Examples of Vega-Lite usage without Streamlit can be found at
  https://vega.github.io/vega-lite/examples/. Most of those can be easily
  translated to the syntax shown above.
docstr_tok: ["Display","a","chart","using","the","Vega-Lite","library",".","Parameters","--","--","--","--","--","data",":","pandas.DataFrame",",","pandas.Styler",",","pyarrow.Table",",","numpy.ndarray",",","Iterable",",","dict",",","or","None","Either","the","data","to","be","plotted","or","a","Vega-Lite","spec","containing","the","data","(","which","more","closely","follows","the","Vega-Lite","API",")",".","spec",":","dict","or","None","The","Vega-Lite","spec","for","the","chart",".","If","the","spec","was","already","passed","in","the","previous","argument",",","this","must","be","set","to","None",".","See","https",":","\/\/vega.github.io\/vega-lite\/docs\/","for","more","info",".","use_container_width",":","bool","If","True",",","set","the","chart","width","to","the","column","width",".","This","takes","precedence","over","Vega-Lite","'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",".","*","*","kwargs",":","any","Same","as","spec",",","but","as","keywords",".","Example","--","--","--","-",">",">",">","import","streamlit","as","st",">",">",">","import","pandas","as","pd",">",">",">","import","numpy","as","np",">",">",">",">",">",">","chart_data","=","pd.DataFrame","(","np.random.randn","(","200",",","3",")",",","columns=","[","``","a","''",",","``","b","''",",","``","c","''","]",")",">",">",">",">",">",">","st.vega_lite_chart","(","...","chart_data",",","...","{","...","``","mark","''",":","{","``","type","''",":","``","circle","''",",","``","tooltip","''",":","True","}",",","...","``","encoding","''",":","{","...","``","x","''",":","{","``","field","''",":","``","a","''",",","``","type","''",":","``","quantitative","''","}",",","...","``","y","''",":","{","``","field","''",":","``","b","''",",","``","type","''",":","``","quantitative","''","}",",","...","``","size","''",":","{","``","field","''",":","``","c","''",",","``","type","''",":","``","quantitative","''","}",",","...","``","color","''",":","{","``","field","''",":","``","c","''",",","``","type","''",":","``","quantitative","''","}",",","...","}",",","...","}",",","...",")","..","output",":",":","https",":","\/\/doc-vega-lite-chart.streamlit.app\/","height",":","300px","Examples","of","Vega-Lite","usage","without","Streamlit","can","be","found","at","https",":","\/\/vega.github.io\/vega-lite\/examples\/",".","Most","of","those","can","be","easily","translated","to","the","syntax","shown","above","."]
code: def vega_lite_chart(
      self,
      data: Data = None,
      spec: Dict[str, Any] | None = None,
      use_container_width: bool = False,
      theme: Literal["streamlit"] | None = "streamlit",
      **kwargs: Any,
  ) -> "DeltaGenerator":
      """Display a chart using the Vega-Lite library.
  
      Parameters
      ----------
      data : pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, Iterable, dict, or None
          Either the data to be plotted or a Vega-Lite spec containing the
          data (which more closely follows the Vega-Lite API).
  
      spec : dict or None
          The Vega-Lite spec for the chart. If the spec was already passed in
          the previous argument, this must be set to None. See
          https://vega.github.io/vega-lite/docs/ for more info.
  
      use_container_width : bool
          If True, set the chart width to the column width. This takes
          precedence over Vega-Lite'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.
  
      **kwargs : any
          Same as spec, but as keywords.
  
      Example
      -------
      >>> import streamlit as st
      >>> import pandas as pd
      >>> import numpy as np
      >>>
      >>> chart_data = pd.DataFrame(np.random.randn(200, 3), columns=["a", "b", "c"])
      >>>
      >>> st.vega_lite_chart(
      ...    chart_data,
      ...    {
      ...        "mark": {"type": "circle", "tooltip": True},
      ...        "encoding": {
      ...            "x": {"field": "a", "type": "quantitative"},
      ...            "y": {"field": "b", "type": "quantitative"},
      ...            "size": {"field": "c", "type": "quantitative"},
      ...            "color": {"field": "c", "type": "quantitative"},
      ...        },
      ...    },
      ... )
  
      .. output::
         https://doc-vega-lite-chart.streamlit.app/
         height: 300px
  
      Examples of Vega-Lite usage without Streamlit can be found at
      https://vega.github.io/vega-lite/examples/. Most of those can be easily
      translated to the syntax shown above.
  
      """
      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,
          data,
          spec,
          use_container_width=use_container_width,
          theme=theme,
          **kwargs,
      )
      return self.dg._enqueue("arrow_vega_lite_chart", proto)
  
file_path: streamlit/lib/streamlit/elements/arrow_vega_lite.py
imports: from __future__ import annotations
  import json
  from typing import TYPE_CHECKING, Any, Dict, Optional, Union, cast
  from typing_extensions import Final, Literal
  import streamlit.elements.lib.dicttools
  from streamlit.elements import arrow
  from streamlit.elements.arrow import Data
  from streamlit.errors import StreamlitAPIException
  from streamlit.logger import get_logger
  from streamlit.proto.ArrowVegaLiteChart_pb2 import ArrowVegaLiteChart
  from streamlit.runtime.metrics_util import gather_metrics
label_desc: Use image node_id 1 for calling the ArrowVegaLiteMixin obj's underlying member method code with example usage: obj.vega_lite_chart(data, spec, use_container_width, theme) and returns: self