
    -PhY&                     D    d  Z d Zd Zd Zd ZddZd Zd Zd	 Zd
 Z	dS )c                     t          |           dk    rt          d          t          t          |                     t          |           z  S )N    zx must have positive length)len
ValueErrorfloatsumxs    V/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/plotly/shapeannotation.py_meanr      s=    
1vv{{6777Q==3q66!!    c                 X    t          t          |           d           d         d         S )Nc                     | d         S N    ts    r
   <lambda>z_argmin.<locals>.<lambda>   
    ad r   )keyr   sorted	enumerater   s    r
   _argminr   
   s'    )A,,NN333A6q99r   c                 Z    t          t          |           d d          d         d         S )Nc                     | d         S r   r   r   s    r
   r   z_argmax.<locals>.<lambda>   r   r   T)r   reverser   r   r   s    r
   _argmaxr      s)    )A,,NNDAAA!DQGGr   c                 *    t          | |||d          S )zDefault annotation parametersF)xanchoryanchorr	   y	showarrow)dict)r    r!   r	   r"   s       r
   _df_annor%      s    AeLLLLr   c                 @    d| v sd| v s|                      d           | S )Ninsideoutside)add)poss    r
   _add_inside_to_positionr+      s,    OOyC//Jr   Fc                 |    | d} | }t          |                     d                    } |rt          |           } | |fS )Nz	top right )setsplitr+   )positionprepend_insidepos_strs      r
   _prepare_positionr3      sK    G8>>#&&''H 5*844Wr   c                 `   |d         }|d         }|d         }|d         }||g}||g}d}	d}
d}d}d	}d
}t          |          }t          |          }t          |          }t          |          }t	          |          }t          |          }t          |          }t          |          }t          |          }t	          |          }t          |          \  }}| dk    rZ|t          ddg          k    rt          |	|
||         |          S |t          ddg          k    rt          ||
||         |          S |t          dg          k    rt          ||||         |          S |t          d	dg          k    rt          |	|||         |          S |t          d	dg          k    rt          ||||         |          S |t          d	g          k    rt          ||
||         |          S |t          dg          k    rt          |	|||          S |t          dg          k    rt          ||||          S n_| dk    rX|t          ddg          k    rt          |||||                   S |t          ddg          k    rt          |	||||                   S |t          dg          k    rt          ||||          S |t          d	dg          k    rt          ||
|||                   S |t          d	dg          k    rt          |	|
|||                   S |t          d	g          k    rt          ||
||          S |t          dg          k    rt          |	||||                   S |t          dg          k    rt          |||||                   S t          d|d          )Nx0x1y0y1righttopleftcenterbottommiddlevlinehlinezInvalid annotation position "")	maxminr   r   r   r3   r.   r%   r   )
shape_type
shape_argsr0   r5   r6   r7   r8   XYRTLCBMaYiYeYaaYaiYaXiXeXaaXaiXr2   s                             r
   annotation_params_for_linerX   '   s   
 
D	B	D	B	D	B	D	B	RA	RAAAAAAA	QB	QB	qB
!**C
!**C	QB	QB	qB
!**C
!**C)(33HgWsE6?++++Aq!C&"---sE7+,,,,Aq!C&"---sE7||##Aq!C&"---sHf-....Aq!C&"---sHg.////Aq!C&"---sH:&&Aq!C&"---sF8}}$$Aq"b)))sG9~~%%Aq"b))) &	w		sE6?++++Aq"af---sE7+,,,,Aq"af---sE7||##Aq"b)))sHf-....Aq"af---sHg.////Aq"af---sH:&&Aq"b)))sF8}}$$Aq"af---sG9~~%%Aq"af---
*777D
E
EEr   c           	      6
   |d         }|d         }|d         }|d         }t          |d          \  }}|t          g d          k    r0t          dd	t          ||g          t	          ||g                    S |t          g d
          k    r0t          dd	t	          ||g          t	          ||g                    S |t          dd	g          k    r0t          dd	t          ||g          t	          ||g                    S |t          g d          k    r0t          ddt          ||g          t          ||g                    S |t          g d          k    r0t          ddt	          ||g          t          ||g                    S |t          ddg          k    r0t          ddt          ||g          t          ||g                    S |t          ddg          k    r0t          ddt          ||g          t          ||g                    S |t          ddg          k    r0t          ddt	          ||g          t          ||g                    S |t          dg          k    r0t          ddt          ||g          t          ||g                    S |t          g d          k    r@t          | dk    rdnd| dk    rdnd	t          ||g          t	          ||g                    S |t          g d          k    r@t          | dk    rdnd| dk    rdnd	t	          ||g          t	          ||g                    S |t          dd	g          k    r0t          ddt          ||g          t	          ||g                    S |t          g d          k    r@t          | dk    rdnd| dk    rd	ndt          ||g          t          ||g                    S |t          g d          k    r@t          | dk    rdnd| dk    rd	ndt	          ||g          t          ||g                    S |t          ddg          k    r0t          dd	t          ||g          t          ||g                    S |t          ddg          k    r0t          ddt          ||g          t          ||g                    S |t          ddg          k    r0t          ddt	          ||g          t          ||g                    S t          d|          )Nr5   r6   r7   r8   T)r1   )r'   r:   r;   r;   r:   )r'   r:   r9   r9   r'   r<   )r'   r=   r;   r=   )r'   r=   r9   r>   )r(   r:   r;   vrecthrect)r(   r:   r9   r(   )r(   r=   r;   )r(   r=   r9   zInvalid annotation position )r3   r.   r%   rC   rB   r   r   )rD   rE   r0   r5   r6   r7   r8   r2   s           r
   annotation_params_for_rectr\   h   sA   	D	B	D	B	D	B	D	B)(4HHHHg30001111sB8}}c2r(mmDDD31112222RHsB8}}EEE3%())))%Bx#r2h--HHH33334444#r2h--b"XGGG344455553Bx==#r2h--HHH3(+,,,,(E2r(OOS"b]]KKK3&)****#r2h--BxIII3'*++++3Bx==%R//JJJ3z??""(E2r(OOUB8__MMM31112222!W,,GG&"g--HH5RMMRMM	
 
 	
 32223333 G++FF"g--HH5RMMRMM	
 
 	
 3	5)****(E2r(OOS"b]]KKK34445555!W,,GG&7**EERMMRMM	
 
 	
 35556666 G++FF7**EERMMRMM	
 
 	
 3	8,----%Bx#r2h--HHH3	6*++++3Bx==%R//JJJ3	7+,,,,#r2h--BxIII
*B
C
CCr   c                 T  
 d
t          
          }t          t          
fd|                                                    }| t          |          dk    rdS | t	                      } |D ]}|dk    r	||d         }||         | |<   d}d|                                v r|d         }|                    d          rt          |||          }	n&|                    d          rt          |||          }	|	                                D ]}|| vs| |         |	|         | |<   | S )a8  
    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                 .    |                                S )N)
startswith)kprefixs    r
   r   z0axis_spanning_shape_annotation.<locals>.<lambda>   s    ALL,@,@ r   Nr   annotation_positionlinerect)r   listfilterkeysr$   endswithrX   r\   )
annotationrD   rE   kwargs
len_prefixannotation_keysra   subkrc   
shape_dictrb   s             @r
   axis_spanning_shape_annotationrp      sr   2 FVJ6"@"@"@"@&++--PPQQO c/22a77t VV
 % %%%%~!!9
4--$%:;6"" 
/
$7
 


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

 __ * *
 ZZ]%:&qMJqMr   c                     t                      }t                      }|                                 D ].}|                    |          r| |         ||<   #| |         ||<   /||fS )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$   rh   r`   )drb   	no_prefixwith_prefixra   s        r
   split_dict_by_key_prefixru      sj     I&&KVVXX    << 	 qTKNNQ4IaLL{##r   N)F)
r   r   r   r%   r+   r3   rX   r\   rp   ru   r   r   r
   <module>rv      s   " " ": : :H H HM M M
     >F >F >FB>D >D >DB= = =@$ $ $ $ $r   