
    e                        d Z ddlZddlZddlmZ ddlmZ ddl	m
Z
mZ  ej        d          ZdZdZ ej        d  eeed	z             D                       Ze                    e          Zd
 Zd Z e
eedd	d          Ze                    de           d Z edd          Ze                    e            eej        geeggd          Z e                                e           dS )z
An example of a simple player widget animating an Image demonstrating
how to connect a simple HoloViews plot with custom widgets and
combine them into a bokeh layout.

The app can be served using:

    bokeh serve --show player.py

    N)curdoc)layout)SliderButtonbokeh
   c           	      t    i | ]5}|t          j        t          j                            d d                     6S )r   )hvImagenprandomrand).0is     Nlib/python3.11/site-packages/holoviews/examples/reference/apps/bokeh/player.py
<dictcomp>r      s4    SSS!1bhry~~b4455SSS       c                  `    t           j        dz   } | t          k    rt          } | t           _        d S )Nr   )slidervalueendstart)years    r   animate_updater      s'    <!DczzFLLLr   c                 N    t                               t          j                   d S )N)plotupdater   r   )attrnameoldnews      r   slider_updater"   #   s    KKr   Year)r   r   r   steptitler   c                      t           j        dk    r5dt           _        t                                          t          d           d S dt           _        t                                          t                     d S )N   ► Playu   ❚❚ Pause   )buttonlabelr   add_periodic_callbackr   remove_periodic_callback r   r   animater.   )   s[    |z!!%&&~s;;;;;!)).99999r   r'   <   )r*   widthfixed)sizing_mode)__doc__numpyr   	holoviewsr
   bokeh.ior   bokeh.layoutsr   bokeh.modelsr   r   rendererr   r   HoloMaprangehmapget_plotr   r   r"   r   	on_changer.   r)   on_clickstateadd_rootr-   r   r   <module>rB      s  	 	                           ' ' ' ' ' ' ' '2;w 	
rzSSuuUCPQE?R?RSSSTT      
eAAV	D	D	D   - ( ( (: : : 
j	+	+	+     
	ZLV 
 
 

   &     r   