
    6DhY&                     D    S  r S rS rS rS rSS jrS rS rS rS	 r	g
)c                 v    [        U 5      S:X  a  [        S5      e[        [        U 5      5      [        U 5      -  $ )N    zx must have positive length)len
ValueErrorfloatsumxs    H/var/www/html/env/lib/python3.13/site-packages/plotly/shapeannotation.py_meanr      s0    
1v{677Q=3q6!!    c                 6    [        [        U 5      S S9S   S   $ )Nc                     U S   $ N    ts    r
   <lambda>_argmin.<locals>.<lambda>       adr   )keyr   sorted	enumerater   s    r
   _argminr   
   s    )A,N3A6q99r   c                 8    [        [        U 5      S SS9S   S   $ )Nc                     U S   $ r   r   r   s    r
   r   _argmax.<locals>.<lambda>   r   r   T)r   reverser   r   r   s    r
   _argmaxr       s    )A,NDA!DQGGr   c                     [        XX#SS9$ )zDefault annotation parametersF)xanchoryanchorr	   y	showarrow)dict)r"   r#   r	   r$   s       r
   _df_annor'      s    AeLLr   c                 @    SU ;   d  SU ;   d  U R                  S5        U $ )Ninsideoutside)add)poss    r
   _add_inside_to_positionr-      s!    OyC/Jr   c                 n    U c  Sn U n[        U R                  S5      5      n U(       a  [        U 5      n X4$ )Nz	top right )setsplitr-   )positionprepend_insidepos_strs      r
   _prepare_positionr5      s;    G8>>#&'H*84r   c                 |   US   nUS   nUS   nUS   nX4/nXV/nSn	Sn
SnSnS	nS
n[        U5      n[        U5      n[        U5      n[        U5      n[	        U5      n[        U5      n[        U5      n[        U5      n[        U5      n[	        U5      n[        U5      u  nnU S:X  Ga   U[        SS/5      :X  a  [        XUU   U5      $ U[        SS/5      :X  a  [        XUU   U5      $ U[        S/5      :X  a  [        XUU   U5      $ U[        S	S/5      :X  a  [        XUU   U5      $ U[        S	S/5      :X  a  [        XUU   U5      $ U[        S	/5      :X  a  [        XUU   U5      $ U[        S/5      :X  a  [        XUU5      $ U[        S/5      :X  a  [        XUU5      $ GOU S:X  a  U[        SS/5      :X  a  [        XUUU   5      $ U[        SS/5      :X  a  [        XUUU   5      $ U[        S/5      :X  a  [        XUU5      $ U[        S	S/5      :X  a  [        XUUU   5      $ U[        S	S/5      :X  a  [        XUUU   5      $ U[        S	/5      :X  a  [        XUU5      $ U[        S/5      :X  a  [        XUUU   5      $ U[        S/5      :X  a  [        XUUU   5      $ [        SU< S35      e)Nx0x1y0y1righttopleftcenterbottommiddlevlinehlinezInvalid annotation position "")	maxminr   r    r   r5   r0   r'   r   )
shape_type
shape_argsr2   r7   r8   r9   r:   XYRTLCBMaYiYeYaaYaiYaXiXeXaaXaiXr4   s                             r
   annotation_params_for_linerZ   '   s   
 
D	B	D	B	D	B	D	B	A	AAAAAAA	QB	QB	qB
!*C
!*C	QB	QB	qB
!*C
!*C)(3HgWsE6?++A!C&"--sE7+,,A!C&"--sE7|#A!C&"--sHf-..A!C&"--sHg.//A!C&"--sH:&A!C&"--sF8}$A"b))sG9~%A"b)) &	w	sE6?++A"af--sE7+,,A"af--sE7|#A"b))sHf-..A"af--sHg.//A"af--sH:&A"b))sF8}$A"af--sG9~%A"af--
7D
EEr   c           	         US   nUS   nUS   nUS   n[        USS9u  p'U[        / SQ5      :X  a"  [        SS	[        X4/5      [	        XV/5      5      $ U[        / S
Q5      :X  a"  [        SS	[	        X4/5      [	        XV/5      5      $ U[        SS	/5      :X  a"  [        SS	[        X4/5      [	        XV/5      5      $ U[        / SQ5      :X  a"  [        SS[        X4/5      [        XV/5      5      $ U[        / SQ5      :X  a"  [        SS[	        X4/5      [        XV/5      5      $ U[        SS/5      :X  a"  [        SS[        X4/5      [        XV/5      5      $ U[        SS/5      :X  a"  [        SS[        X4/5      [        XV/5      5      $ U[        SS/5      :X  a"  [        SS[	        X4/5      [        XV/5      5      $ U[        S/5      :X  a"  [        SS[        X4/5      [        XV/5      5      $ U[        / SQ5      :X  a2  [        U S:X  a  SOSU S:X  a  SOS	[        X4/5      [	        XV/5      5      $ U[        / SQ5      :X  a2  [        U S:X  a  SOSU S:X  a  SOS	[	        X4/5      [	        XV/5      5      $ U[        SS	/5      :X  a"  [        SS[        X4/5      [	        XV/5      5      $ U[        / SQ5      :X  a2  [        U S:X  a  SOSU S:X  a  S	OS[        X4/5      [        XV/5      5      $ U[        / SQ5      :X  a2  [        U S:X  a  SOSU S:X  a  S	OS[	        X4/5      [        XV/5      5      $ U[        SS/5      :X  a"  [        SS	[        X4/5      [        XV/5      5      $ U[        SS/5      :X  a"  [        SS[        X4/5      [        XV/5      5      $ U[        SS/5      :X  a"  [        SS[	        X4/5      [        XV/5      5      $ [        SU< 35      e)Nr7   r8   r9   r:   T)r3   )r)   r<   r=   r=   r<   )r)   r<   r;   r;   r)   r>   )r)   r?   r=   r?   )r)   r?   r;   r@   )r*   r<   r=   vrecthrect)r*   r<   r;   r*   )r*   r?   r=   )r*   r?   r;   zInvalid annotation position )r5   r0   r'   rE   rD   r   r   )rF   rG   r2   r7   r8   r9   r:   r4   s           r
   annotation_params_for_rectr^   h   s   	D	B	D	B	D	B	D	B)(4HH3011sB8}c2(mDD3122RHsB8}EE3%())%x#rh-HH3344#rh-bXGG34553x=#rh-HH3(+,,(E2(OS"]KK3&)**#rh-xII3'*++3x=%/JJ3z?"(E2(OUB8_MM3122!W,G&"g-H5MM	
 	
 3233 G+F"g-H5MM	
 	
 3	5)**(E2(OS"]KK3455!W,G&7*EMM	
 	
 3566 G+F7*EMM	
 	
 3	8,--%x#rh-HH3	6*++3x=%/JJ3	7+,,#rh-xII
B
CCr   c                   ^
 Sm
[        T
5      n[        [        U
4S jUR                  5       5      5      nU c  [        U5      S:X  a  gU c
  [	        5       n U H  nUS:X  a  M  XdS nX6   X'   M     SnSUR                  5       ;   a  US   nUR                  S5      (       a  [        XU5      n	O"UR                  S5      (       a  [        XU5      n	W	R                  5        H  nX`;  d  X   b  M  X   X'   M     U $ )a  
annotation: a go.layout.Annotation object, a dict describing an annotation, or None
shape_type: one of 'vline', 'hline', 'vrect', 'hrect' and determines how the
            x, y, xanchor, and yanchor values are set.
shape_args: the parameters used to draw the shape, which are used to place the annotation
kwargs:     a dictionary that was the kwargs of a
            _process_multiple_axis_spanning_shapes spanning shapes call. Items in this
            dict whose keys start with 'annotation_' will be extracted and the keys with
            the 'annotation_' part stripped off will be used to assign properties of the
            new annotation.

Property precedence:
The annotation's x, y, xanchor, and yanchor properties are set based on the
shape_type argument. Each property already specified in the annotation or
through kwargs will be left as is (not replaced by the value computed using
shape_type). Note that the xref and yref properties will in general get
overwritten if the result of this function is passed to an add_annotation
called with the row and col parameters specified.

Returns an annotation populated with fields based on the
annotation_position, annotation_ prefixed kwargs or the original annotation
passed in to this function.
annotation_c                 &   > U R                  T5      $ )N)
startswith)kprefixs    r
   r   0axis_spanning_shape_annotation.<locals>.<lambda>   s    ALL,@r   Nr   annotation_positionlinerect)r   listfilterkeysr&   endswithrZ   r^   )
annotationrF   rG   kwargs
len_prefixannotation_keysrc   subkrf   
shape_dictrd   s             @r
   axis_spanning_shape_annotationrs      s   2 FVJ6"@&++-PQO c/2a7 V
%%~!9
  -$%:;6""/$7

 
		V	$	$/$7

 __
 Z]%:&MJM  r   c                     [        5       n[        5       nU R                  5        H'  nUR                  U5      (       a  X   X4'   M!  X   X$'   M)     X#4$ )z
Returns two dictionaries, one containing all the items whose keys do not
start with a prefix and another containing all the items whose keys do start
with the prefix. Note that the prefix is not removed from the keys.
)r&   rk   rb   )drd   	no_prefixwith_prefixrc   s        r
   split_dict_by_key_prefixrx      sN     I&KVVX<<TKN4IL	 
 ##r   N)F)
r   r   r    r'   r-   r5   rZ   r^   rs   rx   r   r   r
   <module>ry      s>   ":HM
>FB>DB=@$r   