Ë
    {�hÖ$  ã                   óv   — d dl mZmZ d dlmZ  ej
                  d«      Zd„ Z	 	 	 	 	 	 	 d	d„Z G d„ de	«      Z
y)
é    )Ú
exceptionsÚoptional_imports)Ú
graph_objsÚpandasc                 ód   — ddt        | «      g}t        |«      |vrt        j                  d«      ‚y)zï
    Table-specific validations

    Check that font_colors is supplied correctly (1, 3, or len(text)
        colors).

    :raises: (PlotlyError) If font_colors is supplied incorretly.

    See FigureFactory.create_table() for params
    é   é   z>Oops, font_colors should be a list of length 1, 3 or len(text)N)Úlenr   ÚPlotlyError)Ú
table_textÚfont_colorsÚfont_colors_len_optionss      úZ/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/plotly/figure_factory/_table.pyÚvalidate_tabler      s>   € ð  ! !¤S¨£_Ð5ÐÜ
ˆ;ÓÐ6Ñ6Ü×$Ñ$ØOó
ð 	
ð 7ó    Nc                 ó²  — |�|n
ddgddgddgg}|�|ng d¢}t        | |«       t        | |||||fi |¤Žj                  «       }	t        | |||||fi |¤Žj                  «       }
t	        dd|	d	|d
|dœ|¤Ž}|g}t	        |
t        |	«      |z  dz   t	        dddd¬«      t	        dd
ddddd
¬«      t	        d
ddddd
¬«      ¬«      }t        j                  ||¬«      S )a†
  
    Function that creates data tables.

    See also the plotly.graph_objects trace
    :class:`plotly.graph_objects.Table`

    :param (pandas.Dataframe | list[list]) text: data for table.
    :param (str|list[list]) colorscale: Colorscale for table where the
        color at value 0 is the header color, .5 is the first table color
        and 1 is the second table color. (Set .5 and 1 to avoid the striped
        table effect). Default=[[0, '#66b2ff'], [.5, '#d9d9d9'],
        [1, '#ffffff']]
    :param (list) font_colors: Color for fonts in table. Can be a single
        color, three colors, or a color for each row in the table.
        Default=['#000000'] (black text for the entire table)
    :param (int) height_constant: Constant multiplied by # of rows to
        create table height. Default=30.
    :param (bool) index: Create (header-colored) index column index from
        Pandas dataframe or list[0] for each list in text. Default=False.
    :param (string) index_title: Title for index column. Default=''.
    :param kwargs: kwargs passed through plotly.graph_objs.Heatmap.
        These kwargs describe other attributes about the annotated Heatmap
        trace such as the colorscale. For more information on valid kwargs
        call help(plotly.graph_objs.Heatmap)

    Example 1: Simple Plotly Table

    >>> from plotly.figure_factory import create_table

    >>> text = [['Country', 'Year', 'Population'],
    ...         ['US', 2000, 282200000],
    ...         ['Canada', 2000, 27790000],
    ...         ['US', 2010, 309000000],
    ...         ['Canada', 2010, 34000000]]

    >>> table = create_table(text)
    >>> table.show()

    Example 2: Table with Custom Coloring

    >>> from plotly.figure_factory import create_table
    >>> text = [['Country', 'Year', 'Population'],
    ...         ['US', 2000, 282200000],
    ...         ['Canada', 2000, 27790000],
    ...         ['US', 2010, 309000000],
    ...         ['Canada', 2010, 34000000]]
    >>> table = create_table(text,
    ...                      colorscale=[[0, '#000000'],
    ...                                  [.5, '#80beff'],
    ...                                  [1, '#cce5ff']],
    ...                      font_colors=['#ffffff', '#000000',
    ...                                 '#000000'])
    >>> table.show()

    Example 3: Simple Plotly Table with Pandas

    >>> from plotly.figure_factory import create_table
    >>> import pandas as pd
    >>> df = pd.read_csv('http://www.stat.ubc.ca/~jenny/notOcto/STAT545A/examples/gapminder/data/gapminderDataFiveYear.txt', sep='	')
    >>> df_p = df[0:25]
    >>> table_simple = create_table(df_p)
    >>> table_simple.show()

    r   z#00083eç      à?z#ededeer   ú#ffffff)r   ú#000000r   Úheatmapg      è?F)ÚtypeÚzÚopacityÚ
colorscaleÚ	showscaleÚ	hoverinfoé2   )ÚtÚbÚrÚlÚreversedé   Ú )Ú	autorangeÚzerolineÚ	gridwidthÚticksÚdtickÚtick0Úshowticklabelsg      à¿)r&   r'   r(   r)   r*   r+   )ÚannotationsÚheightÚmarginÚyaxisÚxaxis)ÚdataÚlayout© )r   Ú_TableÚget_table_matrixÚmake_table_annotationsÚdictr
   r   ÚFigure)r   r   r   ÚindexÚindex_titleÚannotation_offsetÚheight_constantr   ÚkwargsÚtable_matrixr,   Útracer1   r2   s                 r   Úcreate_tabler@      se  € ð^ Ð!ñ 	à�)ˆn˜s IÐ.°°I°Ð?ð ð #Ð.‰Ò4Uð ô �:˜{Ô+ÜØØØØØØñð ñ÷ ÑÓð ô ØØØØØØñð ñ÷ ÑÓð ô ð ØØ
ØØØØñð ñ€Eð ˆ7€DÜØÜ�<Ó  ?Ñ2°RÑ7Ü�a˜1  QÔ'ÜØ ØØØØØØ ô
ô ØØØØØØ ô
ô€Fô, ×Ñ $¨vÔ6Ð6r   c                   ó(   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zy)r4   z<
    Refer to TraceFactory.create_table() for docstring
    c                 ó>  — t         r¿t        |t         j                  «      r¥|j                  j	                  «       }|j
                  j	                  «       }	|j                  j	                  «       }|j                  d|«       |rC|	j                  d|«       t        t        |«      «      D ]  }
||
   j                  d|	|
   «       Œ || _
        || _        || _        || _        || _        t        t        |d   «      «      | _        t        t        |«      «      | _        y )Nr   )ÚpdÚ
isinstanceÚ	DataFrameÚcolumnsÚtolistr9   ÚvaluesÚinsertÚranger
   r   r   r   r;   ÚxÚy)Úselfr   r   r   r9   r:   r;   r=   ÚheadersÚtable_text_indexÚis              r   Ú__init__z_Table.__init__¬   sò   € õ ”*˜Z¬¯©Ô6Ø ×(Ñ(×/Ñ/Ó1ˆGØ)×/Ñ/×6Ñ6Ó8ÐØ#×*Ñ*×1Ñ1Ó3ˆJØ×Ñ˜a Ô)ÙØ ×'Ñ'¨¨;Ô7Üœs :›Ó/ò A�AØ˜q‘M×(Ñ(¨Ð,<¸QÑ,?Õ@ðAà$ˆŒØ$ˆŒØ&ˆÔØˆŒ
Ø!2ˆÔÜ”s˜: a™=Ó)Ó*ˆŒÜ”s˜:“Ó'ˆ�r   c                 óÂ  — dgt        | j                  d   «      z  }dgt        | j                  d   «      z  }dgt        | j                  d   «      z  }dgt        | j                  «      z  }||d<   t        dt        | j                  «      d«      D ]  }|||<   Œ	 t        dt        | j                  «      d«      D ]  }|||<   Œ	 | j                  r|D ]  }d|d<   Œ	 |S )zº
        Create z matrix to make heatmap with striped table coloring

        :rtype (list[list]) table_matrix: z matrix to make heatmap with striped
            table coloring.
        r   r   r   Nr#   )r
   r   rJ   r9   )rM   ÚheaderÚodd_rowÚeven_rowr>   rP   Úarrays          r   r5   z_Table.get_table_matrixÇ   sé   € ð �”s˜4Ÿ?™?¨1Ñ-Ó.Ñ.ˆØ�%œ#˜dŸo™o¨aÑ0Ó1Ñ1ˆØ�3œ˜TŸ_™_¨QÑ/Ó0Ñ0ˆØ�v¤ D§O¡OÓ 4Ñ4ˆØ ˆ�Q‰Ü�qœ#˜dŸo™oÓ.°Ó2ò 	&ˆAØ%ˆL˜ŠOð	&ä�qœ#˜dŸo™oÓ.°Ó2ò 	'ˆAØ&ˆL˜ŠOð	'à�:Š:Ø%ò �Ø��a’ðàÐr   c                 ó¤  — t        | j                  «      dk(  r$| j                  t        | j                  «      z  }|S t        | j                  «      dk(  r©t        t	        t        | j                  «      «      «      }| j                  d   |d<   t	        dt        | j                  «      d«      D ]  }| j                  d   ||<   Œ t	        dt        | j                  «      d«      D ]  }| j                  d   ||<   Œ |S t        | j                  «      t        | j                  «      k(  r| j                  }|S dgt        | j                  «      z  }|S )aP  
        Fill font-color array.

        Table text color can vary by row so this extends a single color or
        creates an array to set a header color and two alternating colors to
        create the striped table pattern.

        :rtype (list[list]) all_font_colors: list of font colors for each row
            in table.
        r   r	   r   r#   r   )r
   r   r   ÚlistrJ   )rM   Úall_font_colorsrP   s      r   Úget_table_font_colorz_Table.get_table_font_colorÜ   s<  € ô ˆt×ÑÓ  AÒ%Ø"×.Ñ.´°T·_±_Ó1EÑEˆOð Ðô �×!Ñ!Ó" aÒ'Ü"¤5¬¨T¯_©_Ó)=Ó#>Ó?ˆOØ!%×!1Ñ!1°!Ñ!4ˆO˜AÑÜ˜1œc $§/¡/Ó2°AÓ6ò 9�Ø%)×%5Ñ%5°aÑ%8� Ò"ð9ä˜1œc $§/¡/Ó2°AÓ6ò 9�Ø%)×%5Ñ%5°aÑ%8� Ò"ð9ð Ðô	 �×!Ñ!Ó"¤c¨$¯/©/Ó&:Ò:Ø"×.Ñ.ˆOð Ðð  )˜k¬C°·±Ó,@Ñ@ˆOØÐr   c                 ó<  — t         j                  | «      }t         j                  | «      }g }t        | j                  «      D ]×  \  }}t        |«      D ]Ä  \  }}|dk(  s| j
                  r|dk  rdt        |«      z   dz   n
t        |«      }| j
                  r|dk(  r| j                  d   n||   }	|j                  t        j                  j                  || j                  |   | j                  z
  | j                  |   ddddt        |	¬«      d	¬
«	      «       ŒÆ ŒÙ |S )zœ
        Generate annotations to fill in table text

        :rtype (list) annotations: list of annotations for each cell of the
            table.
        r   r   z<b>z</b>Úx1Úy1Úleft)ÚcolorF)	ÚtextrK   rL   ÚxrefÚyrefÚalignÚxanchorÚfontÚ	showarrow)r4   r5   rZ   Ú	enumerater   r9   Ústrr   Úappendr   r2   Ú
AnnotationrK   r;   rL   r7   )
rM   r>   rY   r,   ÚnÚrowÚmÚvalÚformat_textÚ
font_colors
             r   r6   z_Table.make_table_annotationsö   s%  € ô ×.Ñ.¨tÓ4ˆÜ ×5Ñ5°dÓ;ˆØˆÜ §¡Ó0ò 	‰FˆAˆsÜ# C›.ò ‘��3ð ˜A’v §¢°°A²ð œC ›HÑ$ vÒ-ä˜S›ð ð ,0¯:ª:¸!¸qº&�D×$Ñ$ QÒ'ÀoÐVWÑFXð ð ×"Ñ"Ü×%Ñ%×0Ñ0Ø(ØŸ&™& ™) d×&<Ñ&<Ñ<ØŸ&™& ™)Ø!Ø!Ø$Ø &Ü!¨
Ô3Ø"'ð 1ó 
õñð	ð2 Ðr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rQ   r5   rZ   r6   r3   r   r   r4   r4   §   s   „ ñò(ò6ò*ó4#r   r4   )NNFr$   gÍÌÌÌÌÌÜ?é   Únone)Úplotlyr   r   Úplotly.graph_objsr   Ú
get_modulerC   r   r@   Úobjectr4   r3   r   r   ú<module>r{      sO   ðß /Ý (à Ð× Ñ  Ó*€ò
ð( ØØ
ØØØØóK7ô\rˆVõ rr   