# st.pydeck_chart

Source: https://docs.streamlit.io/develop/api-reference/charts/st.pydeck_chart

* Function signature:

   ```python
   st.pydeck_chart(pydeck_obj=None, *, width="stretch", use_container_width=None, height=500, selection_mode="single-object", on_select="ignore", key=None, alt=None)
   ```

* Parameters:

   | name | type | default | description |
   |---|---|---|---|
   | pydeck_obj | pydeck.Deck or None |  | Object specifying the PyDeck chart to draw. Built-in deck.gl layers, views (MapView, OrbitView, OrthographicView, FirstPersonView, and GlobeView), JSON parameters, and layer extensions are supported. Use map_provider=None to omit the basemap (pydeck 0.9+). Pass extensions as @@type dicts, for example extensions=[{"@@type": "DataFilterExtension", "filterSize": 1}]. Custom JS libraries, widgets, and multi-view layouts are not supported. |
   | width | "stretch" or int |  | The width of the chart element. This can be one of the following:  "stretch" (default): The width of the element matches the width of the parent container. An integer specifying the width in pixels: The element has a fixed width. If the specified width is greater than the width of the parent container, the width of the element matches the width of the parent container. |
   | use_container_width | bool or None | behavior | Whether to override the chart's native width with the width of the parent container. This can be one of the following:  None (default): Streamlit will use the chart's default behavior. True: Streamlit sets the width of the chart to match the width of the parent container. False: Streamlit sets the width of the chart to fit its contents according to the plotting library, up to the width of the parent container. |
   | height | "stretch" or int |  | The height of the chart element. This can be one of the following:  An integer specifying the height in pixels: The element has a fixed height. If the content is larger than the specified height, scrolling is enabled. This is 500 by default. "stretch": The height of the element matches the height of its content or the height of the parent container, whichever is larger. If the element is not in a parent container, the height of the element matches the height of its content. |
   | on_select | "ignore" or "rerun" or callable |  | How the figure should respond to user selection events. This controls whether or not the chart behaves like an input widget. on_select can be one of the following:  "ignore" (default): Streamlit will not react to any selection events in the chart. The figure will not behave like an input widget. "rerun": Streamlit will rerun the app when the user selects data in the chart. In this case, st.pydeck_chart will return the selection data as a dictionary. A callable: Streamlit will rerun the app and execute the callable as a callback function before the rest of the app. In this case, st.pydeck_chart will return the selection data as a dictionary.  If on_select is not "ignore", all layers must have a declared id to keep the chart stateful across reruns. |
   | selection_mode | "single-object" or "multi-object" |  | The selection mode of the chart. This can be one of the following:  "single-object" (default): Only one object can be selected at a time. "multi-object": Multiple objects can be selected at a time. |
   | key | str, int, or None |  | An optional string to use for giving this element a stable identity. If this is None (default), the element's identity will be determined based on the values of the other parameters. If selections are activated and key is provided, Streamlit will register the key in Session State to store the selection state. The selection state is read-only. For more details, see Widget behavior. Additionally, if key is provided, it will be used as a CSS class name prefixed with st-key-. |
   | alt | str or None |  | A description of the chart for screen readers and other assistive technologies. If this is None (default), Streamlit does not provide an accessible name for the chart. An empty or whitespace-only string is treated the same as None and is logged so authors notice the dual meaning of alt="" across commands (decorative only on st.image / st.pyplot). Keep this to a short description of the visual; it is not a full text alternative for dense graphics. |

* Returns: element or PydeckState

    If on_select is "ignore" (default), this command returns an
internal placeholder for the chart element. Otherwise, this method
returns a PydeckState object. This object is dictionary-like
and supports both key and attribute notation. To use this type in
an annotation, import it from streamlit.typing.

## Chart selections

* Function signature:

   ```python
   PydeckState
   ```

* Parameters:

   | name | type | default | description |
   |---|---|---|---|
   | selection | dict |  | The state of the on_select event. This attribute returns a dictionary-like object that supports both key and attribute notation. The attributes are described by PydeckSelectionState. |

* Function signature:

   ```python
   PydeckSelectionState
   ```

* Parameters:

   | name | type | default | description |
   |---|---|---|---|
   | indices | dict[str, list[int]] |  | A dictionary of selected objects by layer. Each key in the dictionary is a layer id, and each value is a list of object indices within that layer. |
   | objects | dict[str, list[dict[str, Any]]] |  | A dictionary of object attributes by layer. Each key in the dictionary is a layer id, and each value is a list of metadata dictionaries for the selected objects in that layer. |
