
    g                        U d Z ddlmZ ddlZddlZddlmZmZmZ ddl	m
Z
 ddlmZ ddlmZ ddlmZ erdd	lmZ dd
lmZ dZded<    G d d      Z	 	 	 	 	 	 	 	 	 	 ddZy)zA Python wrapper around Bokeh.    )annotationsN)TYPE_CHECKINGFinalcast)StreamlitAPIException)
BokehChart)gather_metrics)HASHLIB_KWARGS)Figure)DeltaGeneratorz2.4.3r   ST_BOKEH_VERSIONc                  J    e Zd Z ed      	 d	 	 	 	 	 dd       Zedd       Zy)
BokehMixinbokeh_chartc           	        ddl }|j                  t        k7  r't        dt         d|j                   dt         d      | j                  j                         }t        j                  |j                         fi t        j                         }t               }t        ||||       | j                  j                  d|      S )aD  Display an interactive Bokeh chart.

        Bokeh is a charting library for Python. The arguments to this function
        closely follow the ones for Bokeh's ``show`` function. You can find
        more about Bokeh at https://bokeh.pydata.org.

        To show Bokeh charts in Streamlit, call ``st.bokeh_chart``
        wherever you would call Bokeh's ``show``.

        .. Important::
            You must install ``bokeh==2.4.3`` and ``numpy<2`` to use this
            command.

        Parameters
        ----------
        figure : bokeh.plotting.figure.Figure
            A Bokeh figure to plot.

        use_container_width : bool
            Whether to override the figure's native width with the width of
            the parent container. If ``use_container_width`` is ``True`` (default),
            Streamlit sets the width of the figure to match the width of the parent
            container. If ``use_container_width`` is ``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.

        Example
        -------
        >>> import streamlit as st
        >>> from bokeh.plotting import figure
        >>>
        >>> x = [1, 2, 3, 4, 5]
        >>> y = [6, 7, 2, 4, 5]
        >>>
        >>> p = figure(title="simple line example", x_axis_label="x", y_axis_label="y")
        >>> p.line(x, y, legend_label="Trend", line_width=2)
        >>>
        >>> st.bokeh_chart(p)

        .. output::
           https://doc-bokeh-chart.streamlit.app/
           height: 700px

        r   Nz&Streamlit only supports Bokeh version z, but you have version zG installed. Please run `pip install --force-reinstall --no-deps bokeh==z!` to install the correct version.r   )bokeh__version__r   r   dg_get_delta_path_strhashlibmd5encoder
   	hexdigestBokehChartProtomarshall_enqueue)selffigureuse_container_widthr   
delta_path
element_idbokeh_chart_protos          S/var/www/openai/venv/lib/python3.12/site-packages/streamlit/elements/bokeh_chart.pyr   zBokehMixin.bokeh_chart%   s    d 	 00'89I8J K((-(9(9': ;G#$$EG  WW002
[[!2!2!4GGQQS
+-"F,?Lww/@AA    c                    t        d|       S )zGet our DeltaGenerator.r   )r   )r   s    r#   r   zBokehMixin.dgi   s     $d++r$   N)T)r   r   r   boolreturnr   )r'   r   )__name__
__module____qualname__r	   r   propertyr    r$   r#   r   r   $   sY    M" %)ABAB "AB 
	AB #ABF , ,r$   r   c                p    ddl m}  ||      }t        j                  |      | _        || _        || _        y)zRConstruct a Bokeh chart object.

    See DeltaGenerator.bokeh_chart for docs.
    r   )	json_itemN)bokeh.embedr.   jsondumpsr   r   r!   )protor   r   r!   r.   datas         r#   r   r   o   s1     &VD::d#EL 3E!Er$   )
r2   r   r   r   r   r&   r!   strr'   None)__doc__
__future__r   r   r0   typingr   r   r   streamlit.errorsr   streamlit.proto.BokehChart_pb2r   r   streamlit.runtime.metrics_utilr	   streamlit.utilr
   bokeh.plotting.figurer   streamlit.delta_generatorr   r   __annotations__r   r   r,   r$   r#   <module>r@      sy    % "   - - 2 H 9 ),8! % !H, H,V""" " 	"
 
"r$   