§
    ²[6g>!  ã                   ó¨   — d dl m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mZmZmZmZmZmZmZmZ d„ Zd„ Zd„ Zd„ Zd„ Zd	„ Zd
„ Z	 	 	 	 dd„Zdd„ZdS )é    )ÚSequence)Ú
exceptions)ÚDEFAULT_PLOTLY_COLORSÚPLOTLY_SCALESÚcolor_parserÚcolorscale_to_colorsÚcolorscale_to_scaleÚconvert_to_RGB_255Úfind_intermediate_colorÚ
hex_to_rgbÚ	label_rgbÚn_colorsÚunconvert_from_RGB_255Úunlabel_rgbÚvalidate_colorsÚvalidate_colors_dictÚvalidate_colorscaleÚvalidate_scale_valuesc                 óX   — t          | t          ¦  «        ot          | t          ¦  «         S ©N)Ú
isinstancer   Ústr)Úobjs    úZ/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/plotly/figure_factory/utils.pyÚis_sequencer      s$   € Ý�c�8Ñ$Ô$ÐA­Z¸½SÑ-AÔ-AÐ)AÐAó    c                 ó6  ‡— ddl mŠ t          | d         ‰¦  «        r1t          ˆfd„| D ¦   «         ¦  «        st	          j        d¦  «        ‚dS t          | d         t          ¦  «        r-t          d„ | D ¦   «         ¦  «        st	          j        d¦  «        ‚dS dS )zŸ
    Validates if a list contains all numbers or all strings

    :raises: (PlotlyError) If there are any two items in the list whose
        types differ
    r   ©ÚNumberc              3   ó8   •K  — | ]}t          |‰¦  «        V — Œd S r   ©r   ©Ú.0Úitemr   s     €r   ú	<genexpr>z!validate_index.<locals>.<genexpr>&   s-   øè è € ÐCÐC°•:˜d FÑ+Ô+ÐCÐCÐCÐCÐCÐCr   z^Error in indexing column. Make sure all entries of each column are all numbers or all strings.c              3   ó@   K  — | ]}t          |t          ¦  «        V — Œd S r   ©r   r   ©r#   r$   s     r   r%   z!validate_index.<locals>.<genexpr>/   s,   è è € Ð@Ð@¨T•:˜d¥CÑ(Ô(Ð@Ð@Ð@Ð@Ð@Ð@r   N©Únumbersr   r   Úallr   ÚPlotlyErrorr   )Ú
index_valsr   s    @r   Úvalidate_indexr.      sÛ   ø€ ð ÐÐÐÐÐå�*˜Q”- Ñ(Ô(ð ÝÐCÐCÐCÐC¸
ÐCÑCÔCÑCÔCð 	ÝÔ(ðñô ð ð	ð 	õ 
�J˜q”M¥3Ñ	'Ô	'ð ÝÐ@Ð@°ZÐ@Ñ@Ô@Ñ@Ô@ð 	ÝÔ(ðñô ð ðð ð	ð 	r   c                 ó:  ‡— ddl mŠ | D ]�}t          |d         ‰¦  «        r0t          ˆfd„|D ¦   «         ¦  «        st	          j        d¦  «        ‚ŒHt          |d         t          ¦  «        r-t          d„ |D ¦   «         ¦  «        st	          j        d¦  «        ‚Œ‘dS )z¡
    Validates all strings or numbers in each dataframe column

    :raises: (PlotlyError) If there are any two items in any list whose
        types differ
    r   r   c              3   ó8   •K  — | ]}t          |‰¦  «        V — Œd S r   r!   r"   s     €r   r%   z%validate_dataframe.<locals>.<genexpr>C   s-   øè è € ÐCÐC°D•z $¨Ñ/Ô/ÐCÐCÐCÐCÐCÐCr   zWError in dataframe. Make sure all entries of each column are either numbers or strings.c              3   ó@   K  — | ]}t          |t          ¦  «        V — Œd S r   r'   r(   s     r   r%   z%validate_dataframe.<locals>.<genexpr>K   s,   è è € Ð@Ð@°•z $­Ñ,Ô,Ð@Ð@Ð@Ð@Ð@Ð@r   Nr)   )ÚarrayÚvectorr   s     @r   Úvalidate_dataframer4   8   sÜ   ø€ ð ÐÐÐÐÐàð ð ˆÝ�f˜Q”i Ñ(Ô(ð 	ÝÐCÐCÐCÐC¸FÐCÑCÔCÑCÔCð Ý Ô,ð*ñô ð ðõ ˜˜qœ	¥3Ñ'Ô'ð 	ÝÐ@Ð@¸Ð@Ñ@Ô@Ñ@Ô@ð Ý Ô,ð*ñô ð øðð r   c                  ó�   ‡— t          | d         ¦  «        Št          ˆfd„| D ¦   «         ¦  «        rt          j        d¦  «        ‚dS )z‹
    Validates that data lists or ndarrays are the same length.

    :raises: (PlotlyError) If any data lists are not the same length.
    r   c              3   ó>   •K  — | ]}t          |¦  «        ‰k    V — Œd S r   )Úlen)r#   ÚlstÚlengths     €r   r%   z(validate_equal_length.<locals>.<genexpr>[   s.   øè è € Ð
.Ð
. #�3ˆs‰8Œ8�vÒÐ
.Ð
.Ð
.Ð
.Ð
.Ð
.r   z<Oops! Your data lists or ndarrays should be the same length.N)r7   Úanyr   r,   )Úargsr9   s    @r   Úvalidate_equal_lengthr<   T   s[   ø€ õ ��a”‰\Œ\€FÝ
Ð
.Ð
.Ð
.Ð
.¨Ð
.Ñ
.Ô
.Ñ.Ô.ð 
ÝÔ$ØMñ
ô 
ð 	
ð
ð 
r   c                  óú   — |                       ¦   «         D ]e\  }}	 |dk    r#t          d                     ||¦  «        ¦  «        ‚Œ0# t          $ r) t	          j        d                     ||¦  «        ¦  «        ‚w xY wdS )z¶
    Validates that all values given in key/val pairs are positive.

    Accepts kwargs to improve Exception messages.

    :raises: (PlotlyError) If any value is < 0 or raises.
    r   z{} must be > 0, got {}z{} must be a number, got {}N)ÚitemsÚ
ValueErrorÚformatÚ	TypeErrorr   r,   )ÚkwargsÚkeyÚvals      r   Úvalidate_positive_scalarsrE   a   s¢   € ð —L’L‘N”Nð Yð Y‰ˆˆSð	YØ�aŠxˆxÝ Ð!9×!@Ò!@ÀÀcÑ!JÔ!JÑKÔKÐKð øåð 	Yð 	Yð 	YÝÔ(Ð)F×)MÒ)MÈcÐSVÑ)WÔ)WÑXÔXÐXð	Yøøøð	Yð Ys   ›)AÁ3A8c                 ó`   — 	 d„ | D ¦   «         S # t           $ r t          j        d¦  «        ‚w xY w)z»
    Uses list comprehension to flatten array

    :param (array): An iterable to flatten
    :raises (PlotlyError): If iterable is not nested.
    :rtype (list): The flattened list.
    c                 ó   — g | ]	}|D ]}|‘ŒŒ
S © rH   )r#   Úsublistr$   s      r   ú
<listcomp>zflatten.<locals>.<listcomp>z   s%   € Ð>Ð>Ð>˜°gÐ>Ð>¨d�Ð>Ð>Ð>Ð>r   z\Your data array could not be flattened! Make sure your data is entered as lists or ndarrays!)rA   r   r,   )r2   s    r   ÚflattenrK   q   sP   € ð
Ø>Ð> EÐ>Ñ>Ô>Ð>øÝð 
ð 
ð 
ÝÔ$ð,ñ
ô 
ð 	
ð
øøøs   ‚ Ž-c                 óô  — t          | ¦  «        }t          | t          ¦  «        s)t          | t          ¦  «        st	          j        d¦  «        ‚| D ]+}t          |t          ¦  «        rt	          j        d¦  «        ‚Œ,t          |dz
  ¦  «        D ]+}| |         | |dz            k    rt	          j        d¦  «        ‚Œ,g }|                     t          d¦  «        | d         g¦  «         t          |dz
  ¦  «        D ]R}g }|                     | |         ¦  «         |                     | |dz            ¦  «         |                     |¦  «         ŒS|                     | |dz
           t          d¦  «        g¦  «         |S )a  
    Returns a list of intervals for categorical colormaps

    Accepts a list or tuple of sequentially increasing numbers and returns
    a list representation of the mathematical intervals with these numbers
    as endpoints. For example, [1, 6] returns [[-inf, 1], [1, 6], [6, inf]]

    :raises: (PlotlyError) If input is not a list or tuple
    :raises: (PlotlyError) If the input contains a string
    :raises: (PlotlyError) If any number does not increase after the
        previous one in the sequence
    zZThe intervals_endpts argument must be a list or tuple of a sequence of increasing numbers.é   z-infr   Úinf)
r7   r   ÚtupleÚlistr   r,   r   ÚrangeÚappendÚfloat)Úendptsr9   r$   ÚkÚ	intervalsÚintervals         r   Úendpts_to_intervalsrX   ƒ   s   € õ �‰[Œ[€Få�v¥Ñ'Ô'ð 
­:°f½tÑ+EÔ+Eð 
ÝÔ$ð%ñ
ô 
ð 	
ð ð ð ˆÝ�d�CÑ Ô ð 	ÝÔ(ðñô ð ð	õ �6˜A‘:ÑÔð ð ˆØ�!Œ9˜˜q 1™uœÒ%Ð%ÝÔ(ðñô ð ð &ð ˆ	à×Ò�% ™-œ-¨°¬Ð3Ñ4Ô4Ð4Ý�v ‘zÑ"Ô"ð 	'ð 	'ˆAØˆHØ�OŠO˜F 1œIÑ&Ô&Ð&Ø�OŠO˜F 1 q¡5œMÑ*Ô*Ð*Ø×Ò˜XÑ&Ô&Ð&Ð&à×Ò˜& ¨!¡Ô,­e°E©l¬lÐ;Ñ<Ô<Ð<ØÐr   ÚcolTú#0f0f0fc                 óz  — d|dz
  |z  z
  |z  }|s<d}	d}
|dk    r|dz
  ||z   z  d|z  z   }d}d}nb|dk    r|dz
  ||z   z  d|z  z   }d}d	}nF|dk    rd}	d
}
|dz
  ||z   z  d|z  z   }d}d}n&|dk    r d}
|dz
  ||z   z  d|z  z   }|rd}d}	nd}d}	d}t          ||	|
||ddd| t          d|¬¦  «        ¬¦
  «
        }|S )a#  
    Returns annotation dict for label of n labels of a 1xn or nx1 subplot.

    :param (str) text: the text for a label.
    :param (int) lane: the label number for text. From 1 to n inclusive.
    :param (int) num_of_lanes: the number 'n' of rows or columns in subplot.
    :param (float) subplot_spacing: the value for the horizontal_spacing and
        vertical_spacing params in your plotly.tools.make_subplots() call.
    :param (str) row_col: choose whether labels are placed along rows or
        columns.
    :param (bool) flipped: flips text by 90 degrees. Text is printed
        horizontally if set to True and row_col='row', or if False and
        row_col='col'.
    :param (bool) right_side: only applicable if row_col is set to 'row'.
    :param (str) text_color: color of the text.
    rM   ÚcenterÚmiddlerY   g      à?g{®Gázð?r   ÚrowéZ   Úbottomg      ð?i  Úleftg{®Gáz„¿ÚrightFÚpaperé   )ÚsizeÚcolor)
Ú	textangleÚxanchorÚyanchorÚxÚyÚ	showarrowÚxrefÚyrefÚtextÚfont)Údict)ro   ÚlaneÚnum_of_lanesÚsubplot_spacingÚrow_colÚflippedÚ
right_sideÚ
text_colorÚlrh   ri   rj   rk   rg   Úannotation_dicts                  r   Úannotation_dict_for_labelr{   ¸   sg  € ð4 
ˆl˜QÑ /Ñ1Ñ	1°lÑC€AØð ØˆØˆØ�eÒÐØ˜‘˜a /Ñ1Ñ2°S¸1±WÑ<ˆAØˆAØˆIˆIØ˜ÒÐØ˜‘˜a /Ñ1Ñ2°S¸1±WÑ<ˆAØˆAØˆIøà�eÒÐØˆGØˆGØ˜‘˜a /Ñ1Ñ2°S¸1±WÑ<ˆAØˆAØˆIˆIØ˜ÒÐØˆGØ˜‘˜a /Ñ1Ñ2°S¸1±WÑ<ˆAØð "Ø�Ø ��à�Ø!�ØˆIåØØØØ
Ø
ØØØØÝ�r Ð,Ñ,Ô,ðñ ô €Oð Ðr   Úandc                 ó¬   — t          | ¦  «        dk     rt          j        d¦  «        ‚t          | ¦  «        dz
  dz  dz   |z   dz   |dz  z   } |j        | Ž S )z´
    Returns an English listing of objects seperated by commas ','

    For example, ['foo', 'bar', 'baz'] becomes 'foo, bar and baz'
    if the conjunction 'and' is selected.
    é   z1Your list or tuple must contain at least 2 items.z{}, z{} z {}ú.)r7   r   r,   r@   )ÚiterableÚconjÚperiodÚtemplates       r   Úlist_of_optionsr„   ÿ   sk   € õ ˆ8�}„}�qÒÐÝÔ$Ø?ñ
ô 
ð 	
õ �H‘” Ñ! VÑ+¨eÑ3°dÑ:¸UÑBÀVÈcÁ\ÑQ€HØˆ8Œ?˜HÐ%Ð%r   N)rY   TTrZ   )r|   T)Úcollections.abcr   Úplotlyr   Úplotly.colorsr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r.   r4   r<   rE   rK   rX   r{   r„   rH   r   r   ú<module>rˆ      s’  ðØ $Ð $Ð $Ð $Ð $Ð $à Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð(Bð Bð Bðð ð ð8ð ð ð8

ð 

ð 

ðYð Yð Yð 
ð 
ð 
ð$2ð 2ð 2ðt ØØØðDð Dð Dð DðN&ð &ð &ð &ð &ð &r   