
    	ek                    6   d Z ddlmZ ddlZddlZddlZddlmZ ddlmZm	Z	m
Z
mZmZmZmZ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 d	dl m!Z!m"Z"m#Z# d	dl$m%Z%m&Z'm(Z)m*Z+ d	dl,m-Z- d	dl.m/Z/ d	dl0m1Z1m2Z2m3Z3 d	dl4m5Z5 d	dl6m7Z7 ddl8m9Z9 erddl:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZA dZBdZCdZD G d de9          ZE G d deE          ZF G d  d!eF          ZG G d" d#eF          ZH G d$ d%eE          ZI G d& d'eI          Z& G d( d)eI          ZJ G d* d+eI          ZK G d, d-eI          ZL G d. d/eI          ZM G d0 d1eI          ZN G d2 d3e/eE          ZOd4d5d6d7d8d6d9ZP G d: d;e          ZQ G d< d=eE          ZR G d> d?e9          Z(g d@ZSdS )Aao  
Indicators
==========

Indicators can be used to indicate status or progress

Check out the Panel gallery of indicators
https://panel.holoviz.org/reference/index.html#indicators for inspiration.

How to use indicators
---------------------

>>> pn.indicators.Number(
...    name='Rate', value=72, format='{value}%',
...    colors=[(80, 'green'), (100, 'red')]
... )
    )annotationsN)pi)TYPE_CHECKINGClassVarDictListMappingOptionalTupleType)ColumnDataSourceFixedTickerTooltip)figure)tqdm   )Align)CDN_DIST)ColumnPanelRow)HTMLProgressTooltipIconTrendIndicator)Str)SyncableData)PARAM_NAME_PATTERNescapeupdating)
deprecated)Viewable   )Widget)LockType)Document)Model)Commz#d9534fz#5cb85cz#428bcac                  `    e Zd ZU dZ ej        dg d          ZdZded<   dd	iZ	d
ed<   dZ
d	S )	IndicatorzI
    Indicator is a baseclass for widgets which indicate some state.
    fixedr+   stretch_widthstretch_heightstretch_bothscale_widthscale_height
scale_bothNdefaultobjects zClassVar[Tuple[str]]_linked_propertiesnameN"ClassVar[Mapping[str, str | None]]_renameT)__name__
__module____qualname____doc__paramObjectSelectorsizing_moder7   __annotations__r:   _Indicator__abstractr6       8lib/python3.11/site-packages/panel/widgets/indicators.pyr*   r*   =   sw           '%&w A; A; A; < < <K 021111394.G@@@@JJJrD   r*   c                  :    e Zd ZdZ ej        dd          ZdZdS )BooleanIndicatorzn
    BooleanIndicator is an abstract baseclass for indicators that
    visually indicate a boolean value.
    F0
        Whether the indicator is active or not.r4   docTN)r;   r<   r=   r>   r?   Booleanvalue_BooleanIndicator__abstractr6   rD   rE   rG   rG   M   s@         
 EM% .3 4 4 4E JJJrD   rG   c                       e Zd ZU dZ ej        dg dd          Z ej        dd          Z ej        dd	          Z	 ej
        d
d          ZdddZded<   e dgZded<   eZded<    fdZ xZS )BooleanStatusa  
    The `BooleanStatus` is a boolean indicator providing a visual
    representation of a boolean status as filled or non-filled circle.

    If the value is set to `True` the indicator will be filled while
    setting it to `False` will cause it to be non-filled.

    Reference: https://panel.holoviz.org/reference/indicators/BooleanStatus.html

    :Example:

    >>> BooleanStatus(value=True, color='primary', width=100, height=100)
    darkprimary	secondarysuccessinfodangerwarninglightrP   z
        The color of the circle, one of 'primary', 'secondary', 'success', 'info', 'danger',
        'warning', 'light', 'dark'r4   r5   rJ      z
        height of the circle.rI   z
        Width of the circle.FrH   N)rL   colorr9   _source_transformszcss/booleanstatus.cssClassVar[List[str]]_stylesheetsClassVar[Type[Model]]_widget_typec                    t                                          |          }|                    dd           }|                    dd           }||s|S | j        r	d| j        gndg|d<   |S )NrL   r[   z
dot-filleddotcss_classes)super_process_param_changepoprL   r[   )selfmsgrL   r[   	__class__s       rE   re   z#BooleanStatus._process_param_change|   sr    gg++C00&&&&==J;?:RlDJ77E7M
rD   )r;   r<   r=   r>   r?   r@   r[   IntegerheightwidthrK   rL   r\   rB   r   r^   r   r`   re   __classcell__ri   s   @rE   rO   rO   Y   s)          !E  :Y :Y :Y_&' ' 'E
 U]2 ,! " " "F EM" +  ! ! !E EM% .3 4 4 4E HLVZ=[=[[[[[,4)K)K)K(LLLLLL*.L....        rD   rO   c                       e Zd ZU dZ ej        dddg          Z ej        dg d          Z ej        dd          Z	 ej
        d	d
          ZddiZdddddZded<   e dgZded<   eZded<    fdZ xZS )LoadingSpinnera  
    The `LoadingSpinner` is a boolean indicator providing a visual
    representation of the loading status.

    If the value is set to `True` the spinner will rotate while
    setting it to `False` will disable the rotating segment.

    Reference: https://panel.holoviz.org/reference/indicators/LoadingSpinner.html

    :Example:

    >>> LoadingSpinner(value=True, color='primary', bgcolor='light', width=100, height=100)
    rX   rP   r3   rQ   }   z'
        Size of the spinner in pixels.rI   FrH   r8   textN)rL   r[   bgcolorsizer9   r\   zcss/loadingspinner.cssr]   r^   r_   r`   c           	     h   t                                          |          }d|v r?|                    d          }t          j        |          st          d| d          |d<   |                    dd           }|                    dd           }|                    dd           }|                    d          dk    rd |d<   d	|v sd
|v sd|v rd|v r"|d         |                    d
          k    r|d= t          t          |                    d
| j	                  pt          d          |                    d	| j                                      }d| dg|                    dg           z   |d<   |x|d<   |d<   ||s|s|S | j         d| j         }| j        rdd|gnd| j        g|d<   |S )Nrr   z	<span><b>z</b></span>rL   r[   rs   rA   r+   rt   rk   stylesheetsrl   infz :host { --loading-spinner-size: zpx; }	min_width
min_height-loaderspinrc   )rd   re   rf   r   matchr   getintminrk   floatrt   r[   rs   rL   )	rg   rh   rr   rL   r[   rs   rt   	color_clsri   s	           rE   re   z$LoadingSpinner._process_param_change   s   gg++C00S==776??D%+D11 D$%B%B%B%BCCF&&&&'')T**77=!!W,,!%CS==HOO}/C/C#~~#g,#''(2C2C"C"CLs3778T[99IU5\\377SY[_[dKeKeffggD#St#S#S#S"T"%''-"<"<#=C377Cs<0=%=7=Jz22DL22	>Bjfh	::xY]YeNfM
rD   )r;   r<   r=   r>   r?   r@   rs   r[   rj   rt   rK   rL   r:   r\   rB   r   r^   r   r`   re   rm   rn   s   @rE   rp   rp      s6          #e"7VW<MNNNG E  : : :   E 5= +* + + +D EM% .3 4 4 4E vG t> >     -5)L)L)L(MLMMMM*.L....        rD   rp   c                  :    e Zd ZdZ ej        dd          ZdZdS )ValueIndicatorzT
    A ValueIndicator provides a visual representation for a numeric
    value.
    NT)r4   
allow_None)r;   r<   r=   r>   r?   NumberrL   _ValueIndicator__abstractr6   rD   rE   r   r      s5         
 EL$777EJJJrD   r   c                  ^    e Zd ZU dZ ej        dd          Z ej        dg d          Z ej	        dd	          Z
 ej        d
g d          Z ej	        ddd          Z ej	        d          Ze dgZded<   eZded<    ej        dd          d             Z fdZ xZS )r   a  
    The `Progress` widget displays the progress towards some target
    based on the current `value` and the `max` value.

    If no `value` is set, the `Progress` widget is in indeterminate
    mode and will animate depending on whether it is `active` or
    not. A more beautiful indicator for this use case is the
    `LoadingSpinner`.

    Reference: https://panel.holoviz.org/reference/indicators/Progress.html

    :Example:

    >>> Progress(value=20, max=100, bar_color="primary")
    Tzi
        If no value is set the active property toggles animation of the
        progress bar on and off.rI   rT   rQ   r3   d   &The maximum value of the progress bar.Nr,   r   N
        The current value of the progress bar. If set to -1 the progress
        bar will be indeterminate and animate depending on the active
        parameter.r4   boundsrJ   ,  )r4   zcss/progress.cssr]   r^   r_   r`   maxwatchc                6    d| j         f| j        j        _        d S )Nr   )r   r?   rL   r   rg   s    rE   _update_value_boundszProgress._update_value_bounds   s    #%tx.
rD   c                b     t                      j        di | |                                  d S Nr6   rd   __init__r   rg   paramsri   s     rE   r   zProgress.__init__   8    ""6"""!!#####rD   )r;   r<   r=   r>   r?   rK   activer@   	bar_colorrj   r   rA   rL   rl   r   r^   rB   _BkProgressr`   dependsr   r   rm   rn   s   @rE   r   r      si           U]4 .$ % % %F %$Y A A A   I %-)Q
R
R
RC&%&t >; >; >; < < <K EM"Z >   E
 EM#&&&E,4)F)F)F(GLGGGG*5L5555U]5%%%1 1 &%1$ $ $ $ $ $ $ $ $rD   r   c                  D    e Zd ZU dZ ej        dd          Z ej        dd          Z ej        dd          Z	 ej        d	d
          Z
 ej        dd          Z ej        dd          ZddiZded<   ddddddddZded<   eZded<    fdZ fdZ xZS )r   a2  
    The `Number` indicator renders the `value` as text optionally
    colored according to the `colors` thresholds.

    Reference: https://panel.holoviz.org/reference/indicators/Number.html

    :Example:

    >>> Number(name='Rate', value=72, format='{value}%', colors=[(80, 'green'), (100, 'red')]
    blackD
        The color of the Number indicator if no colors are providedrI   Nz
        Color thresholds for the Number indicator, specified as a tuple of the absolute thresholds
        and the color to switch to.z{value}z4
        A formatter string which accepts a {value}.54pt#
        The size of number itself.rz   z"
        How to format nan values.18pt1
        The size of the title given by the name.r8   r9   r:   )rL   colorsdefault_color	font_sizeformat
nan_format
title_sizer\   r_   r`   c                L    d|vrd |d<    t                      j        di | d S NrA   r6   rd   r   r   s     rE   r   zNumber.__init__+  ;    &&$(F=!""6"""""rD   c                    t                                          |          }t           fd|D                       s|S |                    d j                  }|                    d j                  }|                    d j                  }|                    d j                  }|                    d j                  }|                    d j	                  }|                    d j
                  }|                    d	 j                  }	|	pg d d d
         D ]\  }
}|||
k    r|}|t          d          }|                    |                              d|          }d| d| d| d} j        r)|                    d j                  }d| d| d| d| }t          |          |d<   |S )Nc              3  6   K   | ]}|j         v p|d k    V  dS r8   Nr\   .0prg   s     rE   	<genexpr>z/Number._process_param_change.<locals>.<genexpr>2  4      LL11//>1;LLLLLLrD   r   r   r8   r   rL   r   r   r   r   nanrL   <div style="font-size: 	; color: "></div></div>
rr   )rd   re   anyrf   r   r   r8   r   rL   r   r   r   r   replacer   )rg   rh   r   title_font_sizer8   r   rL   r   r[   r   valclrrr   ri   s   `            rE   re   zNumber._process_param_change0  s   gg++C00LLLLLLLLL 	JGGK88	'',@@wwvty))4;//,,WW\4?;;
);<<4;//2ttt, 	 	HC Uc\\=%LLEE**225*EESSSUSSeSSS9 	e!gglDODDOd_dduddPTdd^bddDTllF
rD   )r;   r<   r=   r>   r?   Stringr   r   r   r   r   r   r   r:   rB   r\   r   r`   r   re   rm   rn   s   @rE   r   r     s        	 	 !EL 7G H H HM UZ +' ( ( (F U\) 27 8 8 8F V 2& ' ' 'I c 0% & & &J f 34 5 5 5J 4:62BGBBBB T> >     +/L....# # # # #
        rD   r   c                       e Zd ZU dZ ej        dd          Z ej        dd          Z ej        dd          Z ej        d	d
d          Z	i Z
ded<   d	d	d	d	dZded<   eZded<    fdZ fdZ xZS )r   z=
    The String indicator renders a string with a title.
    r   r   rI   r   r   r   r   NTz
        The string to displayr4   r   rJ   r9   r:   )rL   r   r   r   r\   r_   r`   c                L    d|vrd |d<    t                      j        di | d S r   r   r   s     rE   r   zString.__init__c  r   rD   c                0    t                                          |          }t           fd|D                       s|S |                    d j                  }|                    d j                  }|                    d j                  }|                    d j                  }|                    d j                  }d| d| d	| d
} j        r)|                    d j                  }d| d| d	| d| }t          |          |d<   |S )Nc              3  6   K   | ]}|j         v p|d k    V  dS r   r   r   s     rE   r   z/String._process_param_change.<locals>.<genexpr>j  r   rD   r   r   r8   rL   r   r   r   r   r   r   rr   )
rd   re   r   rf   r   r   r8   rL   r   r   )	rg   rh   r   r   r8   rL   r[   rr   ri   s	   `       rE   re   zString._process_param_changeh  s*   gg++C00LLLLLLLLL 	JGGK88	'',@@wwvty)),,);<<SSSUSSeSSS9 	e!gglDODDOd_dduddPTdd^bddDTllF
rD   )r;   r<   r=   r>   r?   r   r   r   r   rL   r:   rB   r\   r   r`   r   re   rm   rn   s   @rE   r   r   J  s9          !EL 7G H H HM V 2& ' ' 'I f 34 5 5 5J EL$ =! " " "E 35G4444 4t> >     +/L....# # # # #
        rD   r   c                      e Zd ZU dZ ej        dd          Z ej        dd          Z ej	        dd          Z
 ej        d	
          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Zi Zded<   dddddddddddddd Zded!<   ed"             Z fd#Z  ej!        d$d%          d&             Z" fd'Z# xZ$S )(GaugeaN  
    A `Gauge` represents a value in some range as a position on
    speedometer or gauge. It is similar to a `Dial` but visually a lot
    busier.

    Reference: https://panel.holoviz.org/reference/indicators/Gauge.html

    :Example:

    >>> Gauge(name='Speed', value=79, bounds=(0, 200), colors=[(0.4, 'green'), (1, 'red')])
    
   z"
      Width of the gauge annulus.rI   r   r   -
      The upper and lower bound of the dial.Nz
      Color thresholds for the Gauge, specified as a list of tuples
      of the fractional threshold and the color to switch to.zB
      Additional options to pass to the ECharts Gauge definition.rJ   r   r   Nr4   r   iz%
      Angle at which the gauge ends.{value}%z1
      Formatting string for the value indicator.z(
      Number of splits along the gauge.Tz-
      Whether to show ticks along the dials.z3
      Whether to show tick labels along the dials.   z'
      Angle at which the gauge starts.z
{b} : {c}%z/
      Formatting string for the hover tooltip.   z
      Size of title font.   zI
      Value to indicate on the gauge a value within the declared bounds.r9   r:   )annulus_widthr   r   custom_opts	end_angler   
num_splits
show_ticksshow_labelsstart_angletooltip_formatr   rL   r\   c                p    dt           j        vrddlm} n t	          t           j        d         d          }|S )Nzpanel.models.echartsr   )EChartsr   )sysmodulesmodels.echartsr   getattr)rg   r   s     rE   r`   zGauge._widget_type  s@    !440000000ck*@A9MMGrD   c                b     t                      j        di | |                                  d S r   r   r   s     rE   r   zGauge.__init__  r   rD   r   r   c                2    | j         | j        j        _         d S Nr   r?   rL   r   s    rE   r   zGauge._update_value_bounds      "&+
rD   c                v   t                                          |          }|                    d| j                  \  }}d|                    d| j                  iddd|                    d| j                  id|                    d| j                  id	|                    d
| j                  dddidd|                    d| j                  i|||                    d| j	                  |                    d| j
                  |                    d| j                  |                    d| j                  | j        dgdd|                    d| j                  iidgd|d<   |                    d| j                  }|r#||d         d         d         d         d         d<   |                    d| j                  }|rn|d         d         d         }|                                D ]E\  }}||vst%          ||         t&                    s|||<   *||                             |           F|S ) Nr   	formatterr   r   gaugeshowr   r   boldr   )
fontWeightfontSizeTz100%r   r   r   r   rL   )rL   r8   	lineStylerl   r   )r8   typeaxisTick	axisLabeltitle	splitLineradiusdetailr   r   
startAngleendAnglesplitNumberdataaxisLine)tooltipseriesr   r   r  r   r   r[   r   )rd   re   rf   r   r   r   r   r   r   r   r   r   rL   r8   r   r   r   items
isinstancedictupdate)
rg   rh   vminvmaxr   r   r   kvri   s
            rE   re   zGauge._process_param_change  sA   gg++C00WWXt{33
d SWW%5t7JKK  #SWW\4?%K%KL$cggmT=M&N&NO(.CGGLRVRa<b<bcc$d^ &$+(F(FG!ggmT5EFFGGK@@"ww|T_EE#&777DJ#?#?SST$:L!M!M"  	
 
F4 4;// 	PIOCK!!$Z0=gFggmT-=>> 	'K)!,E#))++ ' '1E>>E!Hd)C)C> E!HH!HOOA&&&&
rD   )%r;   r<   r=   r>   r?   rj   r   Ranger   r   r   r   r   rk   r   r   r   r   r   rK   r   r   r   r   r   rL   rl   r:   rB   r\   propertyr`   r   r   r   re   rm   rn   s   @rE   r   r   y  s        
 
 "EM" 3% & & &M U[ 00 1 1 1F UZ +A B B BF %* "E F F FK U]3y999FS /( ) ) )I U\* 34 5 5 5F r 0+ , , ,J t 20 1 1 1J  %- 36 7 7 7K %,s 1* + + +K "U\, =2 3 3 3N r 0   J EL *L M M ME EM#i888E24G4444 $$$tt4> >       X$ $ $ $ $ U]84(((. . )(.( ( ( ( ( ( ( ( (rD   r   c                  *    e Zd ZU dZ ej        dd          Z ej        dd          Z ej	        dd          Z
 ej        d	d
          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd d!"          Z ej        dd          Zg d#Zd$ed%<   eZd$ed&<   d'd(iZd)ed*<    fd+Z  ej!        d,d -          d.             Z"d/ Z#d2d0Z$d1 Z% xZ&S )3Diala^  
    A `Dial` represents a value in some range as a position on an
    annular dial. It is similar to a `Gauge` but more minimal
    visually.

    Reference: https://panel.holoviz.org/reference/indicators/Dial.html

    :Example:

    >>> Dial(name='Speed', value=79, format="{value} km/h", bounds=(0, 200), colors=[(0.4, 'green'), (1, 'red')])
    g?z>
      Width of the radial annulus as a fraction of the total.rI   r   r   Nz
      Color thresholds for the Dial, specified as a list of tuples
      of the fractional threshold and the color to switch to.	lightblueH
      Color of the radial annulus if not color thresholds are supplied.r   z$
      Angle at which the dial ends.r   H
      Formatting string for the value indicator and lower/upper bounds.   r#   Nr   r   z'
      Color for all extraneous labels.rz    
      How to format nan values.z 
      Color of the Dial needle.皙?z"
      Radial width of the needle.i3z&
      Angle at which the dial starts.z,
      Font size of the Dial min/max labels.z#
      Font size of the Dial title.
whitesmokez0
      Color of the unfilled region of the Dial.z)
      Font size of the Dial value label.TH
      Value to indicate on the dial a value within the declared bounds.r   )rL   r   r   r   r   r   
backgroundneedle_width	tick_sizer   
value_sizer   r   unfilled_colorrk   rl   r   needle_colorlabel_colorr]   _manual_params_data_paramsr  background_fill_colorr9   r:   c                b     t                      j        di | |                                  d S r   r   r   s     rE   r   zDial.__init__G  r   rD   r   r   c                2    | j         | j        j        _         d S r   r   r   s    rE   r   zDial._update_value_boundsK  r   rD   c           	     	   | j         \  }}| j        }|t          d          }||z
  ||z
  z  }t          j        d| j        z
            t          dt          z  z  z
  t          z   }t          j        d| j        z
            t          dt          z  z  z
  t          z   }t          ||z
            t          dz  z  }||k    rt          dz  |z
  }||z  }	t          j	        |          r|n||	z
  }
d| j
        z
  }| j        }| j        pg d d d         D ]\  }}||k    r|}t          j        ||
g          t          j        |
|g          || j        gt          j        ||g          d}g g g g g f\  }}}}}| j        pg }t          |d d         |dd                    D ]\  \  }}\  }}|||z  z
  }||||z
  z  z   |k    r#t          j        |          t          j        |          }}||z  ||z  }}|                    |           |                    |           |                    |           |                    |           |                    |           |||||d}d| j
        dz  z
  }t          j        |
          |z  t          j        |
          |z  }}t          |
z   | j        dz  z
  } t          |
z   | j        dz  z   }!t          j        |g          t          j        |g          t          j        | g          t          j        |!g          t          j        |g          d	}"| j                            |
                              d| j                  }| j                            |
          }#| j                            |
          }$t          j        |          |z  t          j        |          |z  }&}%t          j        |          |z  t          j        |          |z  }(}'|t          z   |t          t          z  z   }*})| j        dz  }+| j        r| j        nd|+dz  z  },| j        r| j        nd|+dz  z  }-| j        r| j        nd|+dz  z  }.t          j        dd|%|'g          t          j        dd|&|(g          | j        ||#|$gt          j        dd|)|*g          |,|-|.|.g| j        || j        | j        gd}/||"||/fS )Nr   ih  r   r#   r   )startsendsr[   r   )x0y0x1y1r[   g       @)xystartendr   r     z%spt    0   r   r   gɿg      )r+  r,  rr   rotrt   r[   )r   rL   r   npradiansr   r   r   absisnanr   r   r   arrayr  zipcossinappendr  r   r   r   rk   r   r  r  r8   r  )0rg   
propertiesr  r  rL   fractionr-  r.  distanceradial_fractionangleinner_radiusr[   r   r   annulus_datax0sy0sx1sy1sclrsr   _tangler'  r(  r)  r*  threshold_datacenter_radiusr+  r,  needle_start
needle_endneedle_data	min_value	max_valuetminxtminytmaxxtmaxy
tmin_angle
tmax_anglescaler   r  r  	text_datas0                                                   rE   	_get_datazDial._get_dataO  s   [
d
=%LLE$Jd+C 0011B!B$K?2Ez#dn,--ad;rAE	NNbd+u991hH"8+(++H%2G++"*DDbD1 	 	HC3 hu~..hs|,,d12hl;<<	
 
 $&r2r2#5 S#sD""%fSbSk6!"":">"> 
	 
	HS!hq#HSL)Fsd4i((U22VF^^RVF^^B_boBJJrNNNJJrNNNJJrNNNJJrNNNKK S3
 
 $,R//ve}}]*BF5MM-,G1%x!22!56Xt034
hsmmhsmmh~..h
|,,h//
 
 """//77tOOK&&T&22	K&&T&22	ve}}]2BF5MM-4Ouvc{{=0"&++m2Ku!&r3rBw;J
S(,PT__VuRx=P
(,PT__VuRx=P
&*nMDNN&E"H:M	 HaE5122Hc3u566Yy)<HaJ
;<<Y	B&t/?AQR
 
	 [.)CCrD   c                   |                      |          }t          d%ddg d d | j        | j        d|}d|j        _        d|j        _        d|j        _        |                     |          \  }}}	}
t          |d          }|
                    ddddd	d
ddd|
  
         t          |d          }|                    ddddd| j        | j        |d	  	         t          |	d          }|                    ddddd|d           t          |
d          }|                    ddddd d|d!d"#	  	         | j                            |           ||}||f| j        |j        d$         <   |S )&N)r   r#   )x_rangey_rangetoolsoutline_line_colortoolbar_locationrl   rk   Fannulus_sourcer   r8   r   r   r#   r%  r&  grayr[   clock)
r+  r,  rA  outer_radiusr   r   
line_colorr[   	directionsourceneedle_sourcer+  r,  r-  r.  needle_renderer)	r+  r,  r   r   r   
fill_colorre  rg  r8   threshold_sourcer'  r)  r(  r*  r   )r'  r)  r(  r*  re  rg  
line_widthlabel_sourcerr   rt   centertopr2  )	r+  r,  rr   r   
text_align
text_colorrg  text_baseliner@  idr6   )_get_propertiesr   rl   rk   xaxisvisibleyaxisgridrY  r   annular_wedgewedger  segmentrr   _designapply_bokeh_theme_to_model_modelsref)rg   rJ   rootparentcommr<  modelannulusneedle	thresholdrr   r`  rh  rk  text_sources                  rE   
_get_modelzDial._get_model  s   ))#..
 
F"#d*T[
 
 5?
 

 $#"
+/>>*+E+E(D *w=MNNN18!w'! 	 	
 	
 	
 )f?KKKSw%(T5F '8 	 	
 	
 	
 ,ASTTT$7K[ 	 	
 	
 	
 'D~FFF

SvH{% 	 	
 	
 	
 	//666<D(-vTXd^$rD   c                   d}|D ]x}|j         dv r |j        di |j         |j        i |j         | j        v rd}5|j         dk    r8|                    d          }	|j        |	j        _        |j        |	j        _        y|sd S |                     |          }
| 	                    |
          \  }}}}|                    d          j
                            |           |                    d          j
                            |           |                    d	          j
                            |           |                    d
          j
                            |           d S )NFrl   rk   Tr  ri  r8   r`  rh  rk  rm  r6   )r8   r  newr   selectglyphre  rj  rt  rY  r   )rg   eventsr  rJ   r  r  r  update_dataeventneedle_rr<  r  r  r  labelss                  rE   _manual_updatezDial._manual_update  sl    	6 	6Ez00077
EI6777zT..."~-- <<-><??,1I),1I) 	F))#..
-1^^J-G-G*F*++077@@@/**/66v>>>,--299)DDD.)).55f=====rD   NNN)'r;   r<   r=   r>   r?   r   r   r  r   r   r   r   r   r   r   rj   rk   r  r   r  r  r   r  r   r  r  rL   rl   r  rB   r   r:   r   r   r   rY  r  r  rm   rn   s   @rE   r  r    sZ        
 
 !EL 3A B B BM U[ 00 1 1 1F UZ +A B B BF !EL ;K L L LM R .' ( ( (I U\* 3K L L LF U]3y999F%,w 5* + + +K c 0# $ $ $J  5< 6# $ $ $L  5< 2% & & &L %,t 2) * * *K T 0/ 0 0 0I d 1& ' ' 'J "U\, =3 4 4 4N d 1, - - -J EL ;K L L LE EM#i888E+ + +N     )7L6666 	-3G    $ $ $ $ $ U]84(((. . )(.LD LD LD\2 2 2 2h> > > > > > >rD   r  c                      e Zd ZU dZ ej        dd          Z ej        dd          Z ej	        dd          Z
 ej        d	d
          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        dd          Z ej        ddd          Z ej        dd          Zg dZg d Zd!gZd"d#ddd$Zd%ed&<   dZ fd'Z  ej!        d(d)          d*             Z"e#d+             Z$d, Z%d6d-Z&d. Z'd/ Z(d0 Z)d1 Z*d2 Z+d3 Z,d4 Z-d5 Z. xZ/S )7LinearGaugea?  
    A LinearGauge represents a value in some range as a position on an
    linear scale. It is similar to a Dial/Gauge but visually more
    compact.

    Reference: https://panel.holoviz.org/reference/indicators/LinearGauge.html

    :Example:

    >>> LinearGauge(value=30, default_color='red', bounds=(0, 100))
    r   z.
      The upper and lower bound of the gauge.rI   r  r  Nz
      Color thresholds for the gauge, specified as a list of tuples
      of the fractional threshold and the color to switch to.z{value:.2f}%r  r   r  r   Fz8
      Whether to display the linear gauge horizontally.rz   r  r   z!
      Color of the gauge needle.z>
      Whether to show the boundaries between colored regions.r  z7
      Color of the unfilled region of the LinearGauge.z$
      Font size of the gauge title.z*
      Font size of the gauge tick labels.z*
      Font size of the gauge value label.r   Tr  r   rq   )rL   r   r   r   r  
horizontalrk   r   r  r  rl   r   r  )rL   r   r   r   r  r   r  r!  r8   )r  r8   show_boundariesr   r9   r:   c                b     t                      j        di | |                                  d S r   r   r   s     rE   r   zLinearGauge.__init__5  r   rD   r   r   c                2    | j         | j        j        _         d S r   r   r   s    rE   r   z LinearGauge._update_value_bounds9  r   rD   c                2   | j         \  }}| j        }| j        rt          | j                  nd||z
  }t	          j        |          r||z  }t          |dz
  z            }nd}d}| j        s'|| j        fg}|                    d| j	        f           n| j
        r!fdt          | j                  D             }nYt          | j        d         t                    r| j        |         n|| j        |         fg}|                    d| j	        f           |S )Nr#   r   c                X    g | ]&\  }}t          |t                    r|n	|d z   z  |f'S )r#   )r  tuple)r   icncolorss      rE   
<listcomp>z0LinearGauge._color_intervals.<locals>.<listcomp>O  sM       Aq  5))C1w/C  rD   )r   rL   r   lenmathisfiniteroundr   r;  r  r  	enumerater  r  )	rg   r  r  rL   intervalr=  idx	intervalsr  s	           @rE   _color_intervalszLinearGauge._color_intervals=  sS   [
d
&*k8#dk"""qI= 	x'HGAI.//CCHC{ 	74-.I a!456666! 
	7   %dk22  II %/t{1~u$E$E 2C  C 01I a!45666rD   c                   | j         \  }}| j        }||z
  }g |g}}d}d }	| j        D ]x\  }
}|
|z  }||	k    r||k    r5|s,|                    |           |                    |           d}| j        }|                    |           |                    |           |}	y| j                            |                              d| j                  }|d d         |dd          |d| j        g|gdfS )	NFTr   r   r   r#   )r(  r*  r[   )r,  rr   )r   rL   r  r;  r  r   r   r   )rg   r<  r  r  rL   r  r   valuesaboveprevr
  r[   r   s                rE   rY  zLinearGauge._get_data[  s,   [
d
IdV/ 	 	JQH*Cd{{u !MM%(((MM%((( E+MM%   MM#DD"""//77tOO#2#;fQRRj6BB:,00
 	
rD   c           	     \   |                      |          }t          dd d g ddd|}d|j        _        d|j        _        d|j        _        d|j        _        d|j        _        |                     |           | 	                    |           | 
                    |           |                     |           |                     |           |                     |           |                     |           | j                            |           |p|}||f| j        |j        d         <   |S )Nr  right)r^  r_  r]  x_axis_locationy_axis_locationFr   rs  r6   )rt  r   rx  rv  ru  major_label_standoffrw  axis_label_standoff_update_name_update_title_size_update_tick_size_update_figure_update_axes_update_renderers_update_boundsr|  r}  r~  r  )rg   rJ   r  r  r  r   r  s          rE   r  zLinearGauge._get_modelu  s<   %%c** 
#d"#W
 
@F
 
 #
+,(+,(*+'*+'%   &&&u%%%E"""%   u%%%E"""//666}u(-vTXd^$rD   c                J    | j         |j        _        | j         |j        _        d S r   )r8   ru  
axis_labelrw  )rg   r  s     rE   r  zLinearGauge._update_name  s     !%!%rD   c                ^    | j         p| j        dz   d}||j        _        ||j        _        d S )N   px)r   rl   ru  axis_label_text_font_sizerw  )rg   r  r   s      rE   r  zLinearGauge._update_title_size  s7    _;4:a<(;(;(;
0:-0:---rD   c                ^    | j         p| j        dz   d}||j        _        ||j        _        d S )N	   r  )r  rl   ru  major_label_text_font_sizerw  )rg   r  r  s      rE   r  zLinearGauge._update_tick_size  s7    N9A&9&9&9	1:.1:...rD   c                   g |_         |                     |j                  }|                     |          \  }}t	          |d          }t	          |d          }| j        r;|                    ddddd|	           d
dt          j        d          d}ddddd}nM|	                    ddddd|           d
dt          j        d          d}ddddt          j        d          d} |j
        d!| j        | j        |ddt          | j        dz            dd| | j        p| j        dz   d}	 |j        d!d||	d | d S )"N
bar_sourcera  rh  r  r(  r*  r#   r[   )r,  leftr  rk   r[   rg        ?r,     )r,  r+  r@  gٿr   r  ro  )r,  r+  rp  rr  g?)r+  bottomro  rl   r[   rg  Z   )r+  r,  r@  r  )r+  r,  rp  rr  r@  ri  triangle   overlay)rj  re  rg  r8   markerrt   levelr  rr   )rr   rg  text_font_sizer6   )	renderersrt  documentrY  r   r  hbarr3  deg2radvbarscatterr  r   rl   r  rr   )
rg   r  r<  r   rN  r  rh  wedge_paramstext_paramsr  s
             rE   r  zLinearGauge._update_renderers  s   ))%.99
 NN:66k%4lCCC
(kPPP? 	JJDQg!     "%3CIIL!& KK
 JJdCw!     "%3BHHL!)BJrNN K 	 	
(T5F '8TZ\"")	
 	
 8D	
 	
 	

 _;4:a<(;(;(;

 	
j	
 	
	
 	
 	
 	
 	
rD   c                   | j         rt          | j                  d}}ndt          | j                  }}|j                            |d         |d                    |j                            |d         |d                    d S )N)gr  r   r#   )r-  r.  )r  r  r   r[  r  r\  )rg   r  r[  r\  s       rE   r  zLinearGauge._update_bounds  s    ? 	?$T[11;WGG*E$+,>,>WG71:71:>>>71:71:>>>>>rD   c                .   | j         \  }}||z
  | j        r|gfd| j        D             z   }n||g}t          |          }| j        r&d|j        _        ||j        _        d|j        _        d S d|j        _        d|j        _        ||j        _        d S )Nc                     g | ]
\  }}|z  S r6   r6   )r   r
  rH  r  s      rE   r  z,LinearGauge._update_axes.<locals>.<listcomp>  s!    MMMVaajMMMrD   )ticksTF)	r   r  r  r   r  ru  rv  tickerrw  )rg   r  r  r  r  r  r  s         @rE   r  zLinearGauge._update_axes  s    [
dI 	!FMMMMt7LMMMMEE4LE5)))? 	("&EK!'EK"'EK"'EK"&EK!'EKrD   c                    |                      |j                  }| j        r"|                    | j        | j                   n!|                    | j        | j                    |j        di | d S )Nr  r6   )rt  r  r  r  rk   rl   )rg   r  r   s      rE   r  zLinearGauge._update_figure  sw    %%en55? 	@MMDJM????MM
4;M???vrD   c                   d}|D ]r}|j         dv r|                     |           "|j         dk    r+|                     |           |                     |           X|j         | j        v rd}i|j         dk    r9|                    d          }	|j        |	j        _        |j        |	j        _	        |j         dk    rV|                     |           |                     |           | 
                    |           |                     |           |j         d	k    r|                     |           0|j         d
k    r|                     |           R|j         dk    r|                     |           t|sd S |                     |j                  }
|                     |
          \  }}|                    d          j                            |           |                    d          j                            |           d S )NFr  r   Tr  ri  r  r  r8   r  r   r  rh  )r8   r  r  r  r   r  r  r  re  rj  r  r  r  r  rt  r  rY  r   r  )rg   r  r  rJ   r  r  r  r  r  r  r<  r   rN  s                rE   r  zLinearGauge._manual_update  s    	/ 	/Ez000##E****x''##E***&&u----t000"~-- <<-><??,1I),1I))|++##E***##E***!!%(((&&u----v%%!!%(((({**&&u----|++''... 	F))%.99
 NN:66k,'',33D999/**/66{CCCCCrD   r  )0r;   r<   r=   r>   r?   r  r   r   r   	Parameterr   r   rj   rk   rK   r  r   r  r  r  r   r  r  r   rL   rl   r  r   _rerender_paramsr:   rB   _updatesr   r   r   r  r  rY  r  r  r  r  r  r  r  r  r  rm   rn   s   @rE   r  r    s        
 
 U[ 01 2 2 2F !EL ;K L L LM U_T 0A B B BF U\. 7K L L LF U]3y999Fu 3; < < <J c 0# $ $ $J  5< 6$ % % %L $emE 8A B B BO "U\, =: ; ; ;N d 1' ( ( (J T 0- . . .I d 1- . . .J EL ;K L L LE EM#i888E  N  L
 %~ .	3 3G     H$ $ $ $ $ U]84(((. . )(.   X:
 
 
4   .+ + +; ; ;
; ; ;
#
 #
 #
J? ? ?( ( ("  D D D D D D DrD   r  c                  r    e Zd ZU dZ ej        d          Z ej        dddg          Z ej	        dd	          Z
 ej	        d
d	          Z ej	        ed	          Z ej        dg dd          Z ej	        ed          Z ej	        ed          Z ej        dg d          Z ej	        d          Z ej        dd	          Z ej        dd	          ZdgZded<   dgZded<   ddddZded <   eZd!ed"<    fd#Zd$ Z fd%Zd& Z e!d+ fd'	            Z" fd(Z# fd)Z$ fd*Z% xZ&S ),Trenda  
    The `Trend` indicator enables the user to display a dashboard kpi
    card.

    The card can be layout out as:

    * a column (text and plot on top of each other) or a row (text and
    * plot after each other)

    Reference: https://panel.holoviz.org/reference/indicators/Trend.html

    :Example:

    >>> data = {'x': np.arange(50), 'y': np.random.randn(50).cumsum()}
    >>> Trend(name='Price', data=data, plot_type='area', width=200, height=200)
    zG
      The plot data declared as a dictionary of arrays or a DataFrame.r   columnrowr3   r+  zA
      The name of the key in the plot_data to use on the x-axis.rI   r,  zA
      The name of the key in the plot_data to use on the y-axis.z$
      The color to use in the plot.bar)linesteparear  z0
      The plot type to render the plot data as.rY   z4
      The color used to indicate a positive change.z4
      The color used to indicate a negative change.Nr,   z+The name or a short description of the cardautoz)
      The primary value to be displayed.z<
      A secondary value. For example the change in percent.r   r]   r   r  r   )r   r8   	selectionr9   r:   r_   r`   c                    d|v r)|                     d          |d<   t          ddd            t                      j        di | d S )Nr   r8   z1.3r6   )rf   r!   rd   r   r   s     rE   r   zTrend.__init__@  sX    f#ZZ00F6Nug///""6"""""rD   c                    | j         d | j        g | j        g ifS t          | j         t                    r| j         | j         fS | j         t          j        | j                   fS r   )r   plot_xplot_yr  r  r   from_dfr   s    rE   rY  zTrend._get_dataF  s`    9$+r4;;;;	4(( 	(9di''y*249====rD   c                    t                                                      }|                                 \  | _        | _        t          | j                  |d<   |S )N)r   rg  )rd   _init_paramsrY  
_processed_datar   )rg   propsri   s     rE   r  zTrend._init_paramsM  sK    $$&&&*nn&6&6#*
;;;hrD   c                    g }| j         dk    r|                    d           | j        dk    r|                    d           |r | j        j        |  d S d S )Nr  rL   value_change)rL   r;  r  r?   trigger)rg   r  s     rE   _trigger_auto_valueszTrend._trigger_auto_valuesS  sp    :NN7###&&NN>*** 	)DJ((((	) 	)rD   c                t    |                                   t                                          ||           d S r   )r  rd   _stream)rg   streamrolloverri   s      rE   r  zTrend._stream\  s3    !!###)))))rD   c                \     t                      j        |  |                                  d S r   )rd   _update_cdsr  )rg   r  ri   s     rE   r  zTrend._update_cdsa  s/    V$$!!#####rD   c                x    t          |t                    rd S t                                          |           d S r   )r  _BkTrendIndicatorrd   _update_data)rg   r   ri   s     rE   r  zTrend._update_datae  s9    d-.. 	FT"""""rD   c                   t                                          |          }| j                            | j        g           }d|v r,|d         dk    r t          |          r|d         |d<   nd|d<   d|v rb|d         dk    rVt          |          dk    r>| j                            | j                  dd          \  }}|dk    rdn||z  dz
  |d<   nd|d<   |S )NrL   r  r   r   r  r#   )rd   re   r  r~   r  r  )rg   rh   ysr*  y2ri   s        rE   re   zTrend._process_param_changej  s    gg++C00Z^^DK,,c>>c'lf442ww !!"vG GS  S%8F%B%B2ww{{44RSS9B+-77aaBN##&'N#
rD   r   )'r;   r<   r=   r>   r?   r  r   r@   layoutr   r  r  BLUE
plot_color	plot_typeGREEN	pos_colorRED	neg_colorrA   r8   rL   r  r   rB   r  r:   r  r`   r   rY  r  r  r    r  r  r  re   rm   rn   s   @rE   r  r    s         " 5?  J K K KD "U!(Xu<MNNNFU\# ,D E E EF U\# ,D E E EF d 1' ( ( (J %$U<[<[<[ b3 4 4 4I U )7 8 8 8I S '7 8 8 8I '%&t >; >; >; < < <K 5<MNNNDEOF 1, - - -E #5?6 8? @ @ @L *0L0000+1(N2222 gD3 3G     +<L;;;;# # # # #> > >    ) ) ) * * * * * X*$ $ $ $ $# # # # #
        rD   r  )   r   r   r   )r   r   r   r   )r  r  )r   r   r  r   )   r   r   r   )	text_paneprogressc                  :     e Zd Z fdZd fd	Zd Z fdZ xZS )ptqdmc                n    |                     d          | _         t                      j        |i | d S )N	indicator)rf   
_indicatorrd   r   )rg   argskwargsri   s      rE   r   zptqdm.__init__  s8     **[11$)&)))))rD   Nc                   t                                          ||           | j        j        j        pi }d|vr)| j        pd}t          ||          | j        j        _        | j        _| j        Xt          | j                  | j        _
        t          | j                  | j        _         | j        di | j        | j        _        dS )Nr[   r   )r[   Tr6   )rd   displayr  r  stylescolourr  totalnr   r   rL   _to_textformat_dictrr   )rg   rh   pos	bar_styler  r[   ri   s         rE   r  zptqdm.display  s    S!!!*17R&  K*7E/3F%/H/H/HDO%,:!df&8"%dj//DO$'KKDO!#04=#D#D43C#D#DDO trD   c                ,     | j         ||fi i |ddiS )Nncolsr   )format_meter)rg   r"  r!  r  s       rE   r#  zptqdm._to_text  s/     t EDD-C-C-C-CDDDrD   c                    t                                                       | j        s| j                                         t
          S r   )rd   closeleaver  reset_tqdm)rg   ri   s    rE   r+  zptqdm.close  s7    z 	$O!!###rD   r  )r;   r<   r=   r   r  r#  r+  rm   rn   s   @rE   r  r    s        * * * * *
 
 
 
 
 
E E E        rD   r  c                      e Zd ZU dZ ej        ddd          Z ej        ee	fddd	          Z
 ej        ed
d          Z ej        dd          Z ej        edd          Z ej        dd          Z ej        edd          Z ej        dd          Z ej        ddd          Z ej        dd          Ze	dediZded<   d
d
d
d
dd Zd!ed"<    fd#Z	 	 d@dAd-ZdBdC fd0Zd1 ZdDd3Z dEd5Z! ej"        d6d7          d8             Z# ej"        d9d7          d:             Z$ ej"        d;d7          d<             Z%d= Z&e'j        e&_        d> Z(d? Z) xZ*S )FTqdmaw  
    The `Tqdm` indicator wraps the well known `tqdm` progress
    indicator and displays the progress towards some target in your
    Panel app.

    Reference: https://panel.holoviz.org/reference/indicators/Tqdm.html

    :Example:

    >>> tqdm = Tqdm()
    >>> for i in tqdm(range(0,10), desc="My loop", leave=True, colour='#666666'):
    ...     time.sleep(timeout)
    r   r   r   r   r   Tz8
        The layout for the text and progress indicator.)class_
precedenceconstantrJ   NzMThe `mutithreading.Lock` or `multiprocessing.Lock` object to be used by Tqdm.)r1  r4   rJ   r   r   rI   z=
        The Progress indicator used to display the progress.)r1  r2  rJ    z.
        The current tqdm style progress text.z)
        The pane to display the text to.z
        Allows to create additional space around the component. May
        be specified as a two-tuple of the form (vertical, horizontal)
        or a four-tuple (top, right, bottom, left).r/  r   z
        The width of the component (in pixels). This can be either
        fixed or preferred width, depending on width sizing policy.Fz5
        Whether or not to also write to the console.r  r  z ClassVar[Dict[Type[Panel], str]]_layoutsr8   )rL   r   r   rr   r8   r9   r:   c                                         dd          } j                            ||          }dvr2|dk    rdnd}t          d dd|t          d         |                   d<   d	vr't          d
ddt          d	         |                   d	<    fdt          j        D             }|dk    s	|t          u rt          d	         d         fi |d<   nt          d         d	         fi |d<    t                      j        di   j                             j        t          t          j                              j         j        _         j         j        _         j         j        _        	 ddlm}                      d |                       _        d S # t0          $ r                      dd            _        Y d S w xY w)Nr
  r  r  r-   r+   rZ   i  )ry   rx   rA   marginr  Fr   )r   rA   rx   r7  c           
     Z    i | ]'}|                     |t          |                    (S r6   )r~   r   )r   r   r   rg   s     rE   
<dictcomp>z!Tqdm.__init__.<locals>.<dictcomp>  s3    UUUFJJq'$*:*:;;UUUrD   r  r   )Locklockr6   )rf   r5  r~   r   MARGINr   r"   r?   r   r   rd   r   r   _update_layoutlistr   r  rL   rr   r  objectmultiprocessingr:  _lockImportError)rg   r   r
  rA   layout_paramsr:  ri   s   ``    rE   r   zTqdm.__init__  s%   Hh//""6622f$$-3x-?-?//WK"%sk*62# # #F; V##!)+j)&1	" " "F: VUUUUhnUUUU??fmm"z"F;$7   ;H   F8  &{#VJ%7   ;H   F8 	""6"""
,d8>.B.BCCC H"j $		2,,,,,,FDDFF33DJJJ 	2 	2 	2  FD11DJJJJ	2s   =)F( (%GGrJ   r&   r  Optional[Model]r  r  Optional[Comm]returnr'   c                v    | j                             ||||          }|p|}||f| j        |j        d         <   |S )Nrs  )r
  r  r~  r  )rg   rJ   r  r  r  r  s         rE   r  zTqdm._get_model  sC     &&sD&$??}u(-vTXd^$rD   Model | NoneNonec                ~    t                                          |           | j                            |           d S r   )rd   _cleanupr
  )rg   r  ri   s     rE   rK  zTqdm._cleanup  s7    T"""""rD   c                H     | j         j        j        di d |D              d S )Nc                (    i | ]}|j         |j        S r6   )r8   r  )r   r  s     rE   r9  z'Tqdm._update_layout.<locals>.<dictcomp>  s    #N#N#NeEJ	#N#N#NrD   r6   )r
  r?   r  )rg   r  s     rE   r=  zTqdm._update_layout  s5      OO#N#Nv#N#N#NOOOOOrD   r%   c                    | j         S r   rA  r   s    rE   get_lockzTqdm.get_lock  s
    zrD   r;  c                    || _         d S r   rO  )rg   r;  s     rE   set_lockzTqdm.set_lock  s    


rD   rr   r   c                :    | j         r| j        | j         _        d S d S r   )r  rr   r?  r   s    rE   _update_textzTqdm._update_text  s(    > 	.$(IDN!!!	. 	.rD   rL   c                :    | j         r| j        | j         _        d S d S r   )r  rL   r   s    rE   _update_valuezTqdm._update_value  s(    = 	-"&*DM	- 	-rD   r   c                :    | j         r| j        | j         _        d S d S r   )r  r   r   s    rE   _update_maxzTqdm._update_max!  s(    = 	) $DM	) 	)rD   c                p    | |d<   | j         st          t          j        d          }||d<   t	          |i |S )Nr  wfile)write_to_consoleopenosdevnullr  rg   r  r  fs       rE   __call__zTqdm.__call__&  sD    "{$ 	RZ%%AF6Nd%f%%%rD   c                    | |d<   | j         s#d|vrt          t          j        d          }||d<   t	          j        |i |S )Nr  r[  rZ  )r\  r]  r^  r_  r  pandasr`  s       rE   rd  zTqdm.pandas/  sP    "{$ 	v)=)=RZ%%AF6N|T,V,,,rD   c                ^    | j         j        j        | _        | j         j        j        | _        dS )zResets the parametersN)r?   rL   r4   rr   r   s    rE   r-  z
Tqdm.reset6  s#    Z%-
JO+			rD   r  )
rJ   r&   r  rD  r  rD  r  rE  rF  r'   r   )r  rH  rF  rI  )rF  r%   )r;  r%   rF  rI  )+r;   r<   r=   r>   r?   rj   rL   ClassSelectorr   r   r
  r?  r;  r   r   r  r   rr   r   r  r  r7  rl   rK   r\  r5  rB   r:   r   r  rK  r=  rP  rR  r   rT  rV  rX  rb  r  rd  r-  rm   rn   s   @rE   r0  r0    s/          EM!J =   E
 !U "t Z; = = =F 5fd#vy y yD %-)Q
R
R
RC"u"(r H@ B B BH 5< )1 2 2 2D $#32 D, - - -I U_Q -7 8 8 8F
 EM#i >G H H HE %u}U 98 9 9 9 36ufh1OHOOOO d4v3 3G    (2 (2 (2 (2 (2V 6:?C    # # # # # # #P P P       U]6&&&. . '&. U]7$'''- - ('- U]5%%%) ) &%)& & & }H- - -, , , , , , ,rD   r0  c                  p    e Zd ZU dZ ej        deefd          Z e	dd          Z
eZdd	d
Zded<   dS )r   a  
    The `TooltipIcon` displays a small `?` icon. When you hover over the `?` icon, the `value`
    will display.

    Use the `TooltipIcon` to provide

    - helpful information to users without taking up a lot of screen space
    - tooltips next to Panel widgets that do not support tooltips yet.

    Reference: https://panel.holoviz.org/reference/indicators/TooltipIcon.html

    :Example:

    >>> pn.widgets.TooltipIcon(value="This is a simple tooltip by using a string")
    Descriptionz(
        The description in the tooltip.)r4   r1  rJ   rn  z
        Whether the object should be aligned with the start, end or
        center of its container. If set as a tuple it will declare
        (vertical, horizontal) alignment.rI   Ndescription)r8   rL   r9   r:   )r;   r<   r=   r>   r?   rf  strr   rL   r   align_BkTooltipIconr`   r:   rB   r6   rD   rE   r   r   <  s             EsGn S+ , , ,E E( )- . . .E
 "L;?-2X2XGXXXXXXrD   r   )rG   rO   r  r   r  rp   r   r   r   r   r0  r  r   )Tr>   
__future__r   r  r^  r   r   typingr   r   r   r   r	   r
   r   r   numpyr3  r?   bokeh.modelsr   r   r   bokeh.plottingr   tqdm.asyncior   r.  _paramr   io.resourcesr   r
  r   r   r   modelsr   r   r   r   rl  r   r  pane.markupr   reactiver   utilr   r   r    util.warningsr!   viewabler"   baser$   _threadr%   bokeh.documentr&   bokeh.modelr'   pyviz_commsr(   r  r  r  r*   rG   rO   rp   r   r   r   r   r  r  r  r<  r  r0  __all__r6   rD   rE   <module>r     sa   " # " " " " "  				 



                               ? ? ? ? ? ? ? ? ? ? ! ! ! ! ! ! & & & & & &       # # # # # # ' ' ' ' ' ' ' ' ' '                  # # # # # # 7 7 7 7 7 7 7 7 7 7 & & & & & &             !      ''''''!!!!!!              	 	 	 	 	y 	 	 	* * * * *$ * * *Z; ; ; ; ;% ; ; ;|    Y   0$ 0$ 0$ 0$ 0$~ 0$ 0$ 0$fE E E E E^ E E EP, , , , ,^ , , ,^{ { { { {N { { {|l> l> l> l> l>> l> l> l>^XD XD XD XD XD. XD XD XDvw w w w wL) w w wv +>BB)/BB
 
    E   8[, [, [, [, [,9 [, [, [,|Y Y Y Y Y& Y Y Y<  rD   