§
    ²[6gP  ã                   ó  — d dl mZ d dlmZmZ d dlmZ d dlm	Z	 d dl
mZ  ej        d¦  «        Z ej        d¦  «        Z ej        d¦  «        Zd	„ Zdd„Zdd„Zd„ Zd„ Zd„ Zd„ Zd„ Zdd„Zd„ Zd„ Zd„ Z	 	 	 	 	 	 	 	 	 	 d d„ZdS )!é    )ÚNumber)Ú
exceptionsÚoptional_importsN)Ú
graph_objs)Úmake_subplotsÚpandasÚnumpyzscipy.statsc                 ó  — t                                | t          ¦  «        }t                                |¦  «        }t                                |¦  «        }t                                |dd¬¦  «        }t                                |dd¬¦  «        }t                                |dd¬¦  «        }||z
  }d|z  }t                                ||||z
  k             ¦  «        }	t                                ||||z   k             ¦  «        }
||||||	|
d	œS )
z6
    Calculate statistics for use in violin plot.
    é2   Úlinear)Úinterpolationé   ÚloweréK   Úhigherç      ø?)ÚminÚmaxÚq1Úq2Úq3Úd1Úd2)ÚnpÚasarrayÚfloatr   r   Ú
percentile)ÚdataÚxÚvals_minÚvals_maxr   r   r   ÚiqrÚwhisker_distr   r   s              ú\/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/plotly/figure_factory/_violin.pyÚ
calc_statsr%      sò   € õ 	�
Š
�4�ÑÔ€AÝ�vŠv�a‰yŒy€HÝ�vŠv�a‰yŒy€HÝ	�Š�q˜"¨HˆÑ	5Ô	5€BÝ	�Š�q˜"¨GˆÑ	4Ô	4€BÝ	�Š�q˜"¨HˆÑ	5Ô	5€BØ
ˆr‰'€CØ˜‘9€Lõ 
�Š��!˜˜\Ñ)Ò*Ô+Ñ	,Ô	,€BÝ	�Š��!˜˜\Ñ)Ò*Ô+Ñ	,Ô	,€BàØØØØØØðð ð ó    ú#1f77b4úrgb(0, 0, 0)c                 óÔ   ‡ ‡— ˆ ˆfd„t          t          ‰ ¦  «        ¦  «        D ¦   «         }t          j        ‰ ‰dd|d|t          j                             d|d¬¦  «        dd¬	¦
  «
        S )
zG
    Produces a sideways probability distribution fig violin plot.
    c                 ó�   •— g | ]B}d d                      ‰|         ¦  «        z   dz   d                      ‰|         ¦  «        z   dz   ‘ŒCS )z(pdf(y), y)=(ú{:0.2f}z, ú))Úformat)Ú.0Úir   Úys     €€r$   ú
<listcomp>z$make_half_violin.<locals>.<listcomp>-   sb   ø€ ð ð ð àð 	˜)×*Ò*¨1¨Q¬4Ñ0Ô0Ñ0°4Ñ7¸)×:JÒ:JÈ1ÈQÌ4Ñ:PÔ:PÑPÐSVÑVðð ð r&   ÚlinesÚ Útonextxg      à?Úspline)ÚwidthÚcolorÚshapeÚtext)
r   r0   ÚmodeÚnamer9   ÚfillÚ	fillcolorÚlineÚ	hoverinfoÚopacity)ÚrangeÚlenr   ÚScatterÚscatterÚLine)r   r0   r=   Ú	linecolorr9   s   ``   r$   Úmake_half_violinrG   )   s�   øø€ ðð ð ð ð å•s˜1‘v”v‘”ðñ ô €Dõ
 ÔØ
Ø
ØØØØØÝÔ×$Ò$¨3°iÀxÐ$ÑPÔPØØðñ ô ð r&   c           	      ó    — t          j        | | |z
  gt          | ¦  «        z  t           j                             |d¬¦  «        dddd¬¦  «        S )z2
    Returns a rugplot fig for a violin plot.
    zline-ew-open)r7   ÚsymbolÚmarkersr3   Fr0   )r0   r   Úmarkerr:   r;   Ú
showlegendr?   )r   rC   rB   rD   ÚMarker)ÚvalsÚpdf_maxÚdistancer7   s       r$   Úmake_violin_rugplotrQ   @   s^   € õ ÔØ
Øˆ8�hÑÐ
¥# d¡)¤)Ñ
+ÝÔ!×(Ò(¨u¸^Ð(ÑLÔLØØØØðñ ô ð r&   c           
      óz   — t          j        ddg| |gddt           j                             dd¬¦  «        ¬¦  «        S )z?
    Returns the scatterplot fig of most of a violin plot.
    r   r3   r2   r   ú
rgb(0,0,0)©r6   r7   )r   r0   r;   r:   r>   )r   rC   rD   rE   )r   r   s     r$   Úmake_non_outlier_intervalrU   O   sK   € õ ÔØˆaˆ&Øˆrˆ(ØØÝÔ×$Ò$¨3°lÐ$ÑCÔCðñ ô ð r&   c           
      óØ   — t          j        ddg| |gdd                     | ¦  «        z   dd                     |¦  «        z   gdt           j                             dd¬¦  «        d	¬
¦  «        S )z@
    Makes the upper and lower quartiles for a violin plot.
    r   zlower-quartile: r+   zupper-quartile: r2   é   rS   rT   r9   )r   r0   r9   r:   r>   r?   )r   rC   r-   rD   rE   )r   r   s     r$   Úmake_quartilesrX   \   s~   € õ ÔØˆaˆ&Øˆrˆ(à ×!1Ò!1°"Ñ!5Ô!5Ñ5Ø ×!1Ò!1°"Ñ!5Ô!5Ñ5ð
ð ÝÔ×$Ò$¨1°LÐ$ÑAÔAØð
ñ 
ô 
ð 
r&   c           
      ó†   — t          j        dg| gdd                     | ¦  «        z   gdt          dd¬¦  «        d¬	¦  «        S )
z;
    Formats the 'median' hovertext for a violin plot.
    r   zmedian: r+   rJ   Úsquarezrgb(255,255,255))rI   r7   r9   )r   r0   r9   r:   rK   r?   )r   rC   r-   Údict)r   s    r$   Úmake_medianr\   m   sX   € õ ÔØˆ#Øˆ$Ø˜9×+Ò+¨BÑ/Ô/Ñ/Ð0ØÝ˜8Ð+=Ð>Ñ>Ô>Øðñ ô ð r&   c           
      óT   — t           j                             | |dddddd¬¦  «        }|S )z-
    Makes the x-axis for a violin plot.
    Fr3   )ÚtitlerA   ÚshowgridÚzerolineÚshowlineÚmirrorÚticksÚshowticklabels)r   ÚlayoutÚXAxis)Úxaxis_titleÚxaxis_rangeÚxaxiss      r$   Ú
make_XAxisrj   {   s@   € õ Ô×#Ò#ØØØØØØØØð $ñ 	ô 	€Eð €Lr&   c           
      óT   — t           j                             | ddddddd¬¦  «        }|S )z-
    Makes the y-axis for a violin plot.
    TrW   F)r^   rd   Ú	autorangeÚticklenra   r`   r_   rb   )r   re   ÚYAxis)Úyaxis_titleÚyaxiss     r$   Ú
make_YAxisrq   Œ   s@   € õ Ô×#Ò#ØØØØØØØØð $ñ 	ô 	€Eð €Lr&   Tc                 óL  — t                                | t          ¦  «        } t          | ¦  «        d         }t          | ¦  «        d         }t          | ¦  «        d         }t          | ¦  «        d         }t          | ¦  «        d         }t          | ¦  «        d         }t          | ¦  «        d         }	t                               | ¦  «        }
t                                ||d¦  «        } |
|¦  «        }t                                |¦  «        }|rd	|z  d
z  nd}| |z
  dz
  |dz   g}t          | ||¬¦  «        t          |||¬¦  «        t          ||	¦  «        t          ||¦  «        t          |¦  «        g}|r&|                     t          | |||¬¦  «        ¦  «         ||fS )z?
    Refer to FigureFactory.create_violin() for docstring.
    r   r   r   r   r   r   r   éd   g       @é
   r   gš™™™™™¹?)r=   )rP   r7   )r   r   r   r%   Úscipy_statsÚgaussian_kdeÚlinspacer   rG   rU   rX   r\   ÚappendrQ   )rN   r=   Úrugplotr    r!   r   r   r   r   r   ÚpdfÚxxÚyyÚmax_pdfrP   Úplot_xrangeÚ	plot_datas                    r$   Ú
violinplotr€   �   s   € õ �:Š:�d�EÑ"Ô"€Då˜$ÑÔ Ô&€HÝ˜$ÑÔ Ô&€HÝ	�DÑ	Ô	˜$Ô	€BÝ	�DÑ	Ô	˜$Ô	€BÝ	�DÑ	Ô	˜$Ô	€BÝ	�DÑ	Ô	˜$Ô	€BÝ	�DÑ	Ô	˜$Ô	€Bõ ×
"Ò
" 4Ñ
(Ô
(€Cå	�Š�X˜x¨Ñ	-Ô	-€Bà	ˆˆR‰Œ€BÝ�fŠf�R‰jŒj€Gà'.Ð5��g‘ Ñ#Ð#°A€Hà�8˜hÑ&¨Ñ,¨g¸©mÐ<€Kå˜"˜˜b¨IÐ6Ñ6Ô6Ý˜˜R¨9Ð5Ñ5Ô5Ý! " bÑ)Ô)Ý�r˜2ÑÔÝ�B‰Œð€Ið ð 
Ø×ÒÝ  g¸È	ÐRÑRÔRñ	
ô 	
ð 	
ð �kÐ!Ð!r&   c                 ó¨  — g }| |         D ]}||vr|                      |¦  «         Œ|r|                     ¦   «          |                      |g¦  «        }t          |¦  «        }t	          d|ddd¬¦  «        }d}t          |¦  «        D ]ì\  }}t                               |                     |¦  «        |         t          ¦  «        }|t          |¦  «        k    rd}t          |||         |¬¦  «        \  }}t          j        ¦   «         }|D ]}|                     |d|dz   ¦  «         Œ|dz  }|d                              d	                     |dz   ¦  «        t!          ||         |¦  «        i¦  «         Œí|d                              d
                     d¦  «        t#          d¦  «        i¦  «         |d                              |
ddd||	¬¦  «         |S )úu
    Refer to FigureFactory.create_violin() for docstring.

    Returns fig for violin plot without colorscale.

    é   Tçš™™™™™™?F©ÚrowsÚcolsÚshared_yaxesÚhorizontal_spacingÚ
print_gridr   ©r=   ry   re   úxaxis{}úyaxis{}r3   Úclosest©r^   rL   Ú	hovermodeÚautosizeÚheightr6   )rx   ÚsortÚgroupbyrB   r   Ú	enumerater   r   Ú	get_groupr   r€   r   ÚLayoutÚappend_traceÚupdater-   rj   rq   )r   Údata_headerÚgroup_headerÚcolorsÚuse_colorscaleÚgroup_statsry   r“   r’   r6   r^   Ú
group_namer;   ÚgbÚLÚfigÚcolor_indexÚkÚgrrN   r   r~   re   Úitems                           r$   Úviolin_no_colorscaler§   Ä   s  € ð* €JØ�\Ô"ð $ð $ˆØ�zÐ!Ð!Ø×Ò˜dÑ#Ô#Ð#øØð Ø�ŠÑÔÐà	�Š�|�nÑ	%Ô	%€BÝˆJ‰Œ€Aå
Ø�Q T¸eÐPUðñ ô €Cð €KÝ˜:Ñ&Ô&ð 
ð 
‰ˆˆ2Ý�zŠz˜"Ÿ,š, rÑ*Ô*¨;Ô7½Ñ?Ô?ˆØ�#˜f™+œ+Ò%Ð%ØˆKÝ!+Ø˜F ;Ô/¸ð"
ñ "
ô "
Ñˆ	�;õ Ô"Ñ$Ô$ˆàð 	-ð 	-ˆDØ×Ò˜T 1 a¨!¡eÑ,Ô,Ð,Ð,Ø�qÑˆð 	ˆHŒ×ÒØ×Ò˜a !™eÑ$Ô$¥j°¸A´ÀÑ&LÔ&LÐMñ	
ô 	
ð 	
ð 	
ð
 ˆ„M×Ò˜)×*Ò*¨1Ñ-Ô-­z¸"©~¬~Ð>Ñ?Ô?Ð?Øˆ„M×ÒØØØØØØð ñ ô ð ð €Jr&   c                 óÖ  — g }| |         D ]}||vr|                      |¦  «         Œ|r|                     ¦   «          |D ]}||vrt          j        d¦  «        ‚Œ|                      |g¦  «        }t          |¦  «        }t          d|ddd¬¦  «        }t          j        |d         t          j	        ¦  «        }t          j        |d         t          j	        ¦  «        }g }|D ]}|                      ||         ¦  «         Œt          |¦  «        }t          |¦  «        }t          |¦  «        D �]\  }}t                               |                     |¦  «        |         t           ¦  «        }||         |z
  ||z
  z  }t          j        |||¦  «        }t%          |d                     |¦  «        |¬	¦  «        \  }}t)          j        ¦   «         }|D ]}|                     |d|dz   ¦  «         Œ|d
                              d                     |dz   ¦  «        t1          ||         |¦  «        i¦  «         �Œ	t)          j        dgdgdt5          d||d|d         gd|d         ggd¬¦  «        d¬¦  «        } |                     | d|¦  «         |d
                              d                     d¦  «        t7          d¦  «        i¦  «         |d
                              |
ddd||	¬¦  «         |S )zr
    Refer to FigureFactory.create_violin() for docstring.

    Returns fig for violin plot with colorscale.

    zRAll values/groups in the index column must be represented as a key in group_stats.rƒ   Tr„   Fr…   r   zrgb{}r‹   re   rŒ   rJ   é   )ÚsizeÚcminÚcmaxÚ
colorscaleÚ	showscale)r   r0   r:   rK   rL   r�   r3   rŽ   r�   )rx   r“   r   ÚPlotlyErrorr”   rB   r   ÚclrsÚcolor_parserÚunlabel_rgbr   r   r•   r   r   r–   r   Úfind_intermediate_colorr€   r-   r   r—   r˜   r™   rj   rC   r[   rq   )!r   rš   r›   rœ   r�   rž   ry   r“   r’   r6   r^   rŸ   r;   Úgroupr    r¡   r¢   ÚlowcolorÚ	highcolorÚgroup_stats_valuesÚkeyÚ	max_valueÚ	min_valuer¤   r¥   rN   ÚintermedÚintermed_colorr   r~   re   r¦   Útrace_dummys!                                    r$   Úviolin_colorscaler¾     s[  € ð* €JØ�\Ô"ð $ð $ˆØ�zÐ!Ð!Ø×Ò˜dÑ#Ô#Ð#øØð Ø�ŠÑÔÐð ð ð ˆØ˜Ð#Ð#ÝÔ(ð+ñô ð ð $ð 
�Š�|�nÑ	%Ô	%€BÝˆJ‰Œ€Aå
Ø�Q T¸eÐPUðñ ô €Cõ
 Ô  ¨¤­DÔ,<Ñ=Ô=€HÝÔ! &¨¤)­TÔ-=Ñ>Ô>€Ið ÐØð 4ð 4ˆØ×!Ò! +¨cÔ"2Ñ3Ô3Ð3Ð3åÐ&Ñ'Ô'€IÝÐ&Ñ'Ô'€Iå˜:Ñ&Ô&ð 
ñ 
‰ˆˆ2Ý�zŠz˜"Ÿ,š, rÑ*Ô*¨;Ô7½Ñ?Ô?ˆð   ”O iÑ/°IÀ	Ñ4IÑJˆÝÔ5°hÀ	È8ÑTÔTˆå!+Ø˜GŸNšN¨>Ñ:Ô:ÀGð"
ñ "
ô "
Ñˆ	�;õ Ô"Ñ$Ô$ˆàð 	-ð 	-ˆDØ×Ò˜T 1 a¨!¡eÑ,Ô,Ð,Ð,ØˆHŒ×ÒØ×Ò˜a !™eÑ$Ô$¥j°¸A´ÀÑ&LÔ&LÐMñ	
ô 	
ð 	
ñ 	
õ Ô$Øˆ#Øˆ#ØÝØØØØ˜F 1œI˜¨¨F°1¬I¨Ð7Øð
ñ 
ô 
ð ðñ ô €Kð ×Ò�[ ! QÑ'Ô'Ð'ð ˆ„M×Ò˜)×*Ò*¨1Ñ-Ô-­z¸"©~¬~Ð>Ñ?Ô?Ð?Øˆ„M×ÒØØØØØØð ñ ô ð ð €Jr&   c                 óª  — g }| |         D ]}||vr|                      |¦  «         Œ|r|                     ¦   «          |D ]}||vrt          j        d¦  «        ‚Œ|                      |g¦  «        }t          |¦  «        }t          d|ddd¬¦  «        }t          |¦  «        D ]Ò\  }}t           	                    | 
                    |¦  «        |         t          ¦  «        }t          |||         |¬¦  «        \  }}t          j        ¦   «         }|D ]}|                     |d|dz   ¦  «         Œ|d                              d	                     |dz   ¦  «        t%          ||         |¦  «        i¦  «         ŒÓ|d                              d
                     d¦  «        t'          d¦  «        i¦  «         |d                              |
ddd||	¬¦  «         |S )r‚   zMIf colors is a dictionary, all the group names must appear as keys in colors.rƒ   Tr„   Fr…   r‹   re   rŒ   r�   r3   rŽ   r�   )rx   r“   r   r¯   r”   rB   r   r•   r   r   r–   r   r€   r   r—   r˜   r™   r-   rj   rq   )r   rš   r›   rœ   r�   rž   ry   r“   r’   r6   r^   rŸ   r;   r´   r    r¡   r¢   r¤   r¥   rN   r   r~   re   r¦   s                           r$   Úviolin_dictrÀ   n  s#  € ð* €JØ�\Ô"ð $ð $ˆØ�zÐ!Ð!Ø×Ò˜dÑ#Ô#Ð#øàð Ø�ŠÑÔÐð ð ð ˆØ˜ÐÐÝÔ(ð"ñô ð ð ð 
�Š�|�nÑ	%Ô	%€BÝˆJ‰Œ€Aå
Ø�Q T¸eÐPUðñ ô €Cõ ˜:Ñ&Ô&ð 
ð 
‰ˆˆ2Ý�zŠz˜"Ÿ,š, rÑ*Ô*¨;Ô7½Ñ?Ô?ˆÝ!+¨D¸FÀ2¼JÐPWÐ!XÑ!XÔ!XÑˆ	�;ÝÔ"Ñ$Ô$ˆàð 	-ð 	-ˆDØ×Ò˜T 1 a¨!¡eÑ,Ô,Ð,Ð,ð 	ˆHŒ×ÒØ×Ò˜a !™eÑ$Ô$¥j°¸A´ÀÑ&LÔ&LÐMñ	
ô 	
ð 	
ð 	
ð
 ˆ„M×Ò˜)×*Ò*¨1Ñ-Ô-­z¸"©~¬~Ð>Ñ?Ô?Ð?Øˆ„M×ÒØØØØØØð ñ ô ð ð €Jr&   FéÂ  éX  úViolin and Rug Plotc                 óä  — t          |t          ¦  «        rt          j        |d¦  «        }nt          j        |d¦  «        }|�€}t          | t
          ¦  «        rTt          | ¦  «        dk    rt          j        d¦  «        ‚t          d„ | D ¦   «         ¦  «        st          j        d¦  «        ‚t          rYt          | t          j        j        j        ¦  «        r5|€t          j        d¦  «        ‚| |         j                             ¦   «         } t!          | |d         |¬¦  «        \  }}t#          j        |
d	t"          j                             d
¬¦  «        |d	|	t+          d|¦  «        t-          d¦  «        d¬¦	  «	        }|d                              t          d	d	d¬¦  «        ¦  «         t#          j        ||¬¦  «        }|S t          | t          j        j        j        ¦  «        st          j        d¦  «        ‚|€t          j        d¦  «        ‚|d	u rKt          |t          ¦  «        rt3          | |||||||||	|
¦  «        }|S t5          | |||||||||	|
¦  «        }|S t          |t          ¦  «        rt          j        d¦  «        ‚t          |¦  «        dk     rt          j        d¦  «        ‚t          |t          ¦  «        st          j        d¦  «        ‚t7          | |||||||||	|
¦  «        }|S )a}  
    **deprecated**, use instead the plotly.graph_objects trace
    :class:`plotly.graph_objects.Violin`.

    :param (list|array) data: accepts either a list of numerical values,
        a list of dictionaries all with identical keys and at least one
        column of numeric values, or a pandas dataframe with at least one
        column of numbers.
    :param (str) data_header: the header of the data column to be used
        from an inputted pandas dataframe. Not applicable if 'data' is
        a list of numeric values.
    :param (str) group_header: applicable if grouping data by a variable.
        'group_header' must be set to the name of the grouping variable.
    :param (str|tuple|list|dict) colors: either a plotly scale name,
        an rgb or hex color, a color tuple, a list of colors or a
        dictionary. An rgb color is of the form 'rgb(x, y, z)' where
        x, y and z belong to the interval [0, 255] and a color tuple is a
        tuple of the form (a, b, c) where a, b and c belong to [0, 1].
        If colors is a list, it must contain valid color types as its
        members.
    :param (bool) use_colorscale: only applicable if grouping by another
        variable. Will implement a colorscale based on the first 2 colors
        of param colors. This means colors must be a list with at least 2
        colors in it (Plotly colorscales are accepted since they map to a
        list of two rgb colors). Default = False
    :param (dict) group_stats: a dictionary where each key is a unique
        value from the group_header column in data. Each value must be a
        number and will be used to color the violin plots if a colorscale
        is being used.
    :param (bool) rugplot: determines if a rugplot is draw on violin plot.
        Default = True
    :param (bool) sort: determines if violins are sorted
        alphabetically (True) or by input order (False). Default = False
    :param (float) height: the height of the violin plot.
    :param (float) width: the width of the violin plot.
    :param (str) title: the title of the violin plot.

    Example 1: Single Violin Plot

    >>> from plotly.figure_factory import create_violin
    >>> import plotly.graph_objs as graph_objects

    >>> import numpy as np
    >>> from scipy import stats

    >>> # create list of random values
    >>> data_list = np.random.randn(100)

    >>> # create violin fig
    >>> fig = create_violin(data_list, colors='#604d9e')

    >>> # plot
    >>> fig.show()

    Example 2: Multiple Violin Plots with Qualitative Coloring

    >>> from plotly.figure_factory import create_violin
    >>> import plotly.graph_objs as graph_objects

    >>> import numpy as np
    >>> import pandas as pd
    >>> from scipy import stats

    >>> # create dataframe
    >>> np.random.seed(619517)
    >>> Nr=250
    >>> y = np.random.randn(Nr)
    >>> gr = np.random.choice(list("ABCDE"), Nr)
    >>> norm_params=[(0, 1.2), (0.7, 1), (-0.5, 1.4), (0.3, 1), (0.8, 0.9)]

    >>> for i, letter in enumerate("ABCDE"):
    ...     y[gr == letter] *=norm_params[i][1]+ norm_params[i][0]
    >>> df = pd.DataFrame(dict(Score=y, Group=gr))

    >>> # create violin fig
    >>> fig = create_violin(df, data_header='Score', group_header='Group',
    ...                    sort=True, height=600, width=1000)

    >>> # plot
    >>> fig.show()

    Example 3: Violin Plots with Colorscale

    >>> from plotly.figure_factory import create_violin
    >>> import plotly.graph_objs as graph_objects

    >>> import numpy as np
    >>> import pandas as pd
    >>> from scipy import stats

    >>> # create dataframe
    >>> np.random.seed(619517)
    >>> Nr=250
    >>> y = np.random.randn(Nr)
    >>> gr = np.random.choice(list("ABCDE"), Nr)
    >>> norm_params=[(0, 1.2), (0.7, 1), (-0.5, 1.4), (0.3, 1), (0.8, 0.9)]

    >>> for i, letter in enumerate("ABCDE"):
    ...     y[gr == letter] *=norm_params[i][1]+ norm_params[i][0]
    >>> df = pd.DataFrame(dict(Score=y, Group=gr))

    >>> # define header params
    >>> data_header = 'Score'
    >>> group_header = 'Group'

    >>> # make groupby object with pandas
    >>> group_stats = {}
    >>> groupby_data = df.groupby([group_header])

    >>> for group in "ABCDE":
    ...     data_from_group = groupby_data.get_group(group)[data_header]
    ...     # take a stat of the grouped data
    ...     stat = np.median(data_from_group)
    ...     # add to dictionary
    ...     group_stats[group] = stat

    >>> # create violin fig
    >>> fig = create_violin(df, data_header='Score', group_header='Group',
    ...                     height=600, width=1000, use_colorscale=True,
    ...                     group_stats=group_stats)

    >>> # plot
    >>> fig.show()
    ÚrgbNr   zRIf data is a list, it must be nonempty and contain either numbers or dictionaries.c              3   ó@   K  — | ]}t          |t          ¦  «        V — Œd S )N)Ú
isinstancer   )r.   Úelements     r$   ú	<genexpr>z create_violin.<locals>.<genexpr>P  s,   è è € ÐGÐG°w•z '­6Ñ2Ô2ÐGÐGÐGÐGÐGÐGr&   z0If data is a list, it must contain only numbers.zVdata_header must be the column name with the desired numeric data for the violin plot.r‹   Fé   )rª   r3   rŽ   )	r^   r‘   Úfontr’   rL   r6   ri   rp   r�   rp   )ra   rd   rc   )r   re   zGError. You must use a pandas DataFrame if you are using a group header.zFThe colors param cannot be a dictionary if you are using a colorscale.r©   zHcolors must be a list with at least 2 colors. A Plotly scale is allowed.z,Your group_stats param must be a dictionary.)rÇ   r[   r°   Úvalidate_colors_dictÚvalidate_colorsÚlistrB   r   r¯   ÚallÚpdÚcoreÚframeÚ	DataFrameÚvaluesÚtolistr€   r   r—   re   ÚFontrj   rq   r™   ÚFigurerÀ   r§   r¾   )r   rš   r›   rœ   r�   rž   ry   r“   r’   r6   r^   Úvalid_colorsr   r~   re   r¢   s                   r$   Úcreate_violinrÙ   ¶  s|  € õV �&�$ÑÔð ;ÝÔ0°¸Ñ?Ô?ˆˆåÔ+¨F°EÑ:Ô:ˆð ÑÝ�d�DÑ!Ô!ð 	Ý�4‰yŒy˜AŠ~ˆ~Ý Ô,ð/ñô ð õ ÐGÐGÀ$ÐGÑGÔGÑGÔGð Ý Ô,ØIñô ð õ ð 		5•*˜T¥2¤7¤=Ô#:Ñ;Ô;ð 		5ØÐ"Ý Ô,ð'ñô ð ð ˜Ô$Ô+×2Ò2Ñ4Ô4ˆDõ ",Ø˜L¨œO°Wð"
ñ "
ô "
Ñˆ	�;õ Ô"ØØÝÔ"×'Ò'¨RÐ'Ñ0Ô0ØØØÝ˜R Ñ-Ô-Ý˜R‘.”.Øð

ñ 

ô 

ˆð 	ˆwŒ×Ò�t¨UÀ5ÐPRÐSÑSÔSÑTÔTÐTåÔ Y°vÐ>Ñ>Ô>ˆàˆ
õ ˜$¥¤¤Ô 7Ñ8Ô8ð 	ÝÔ(ð ñô ð ð ÐÝÔ(ð,ñô ð ð ˜UÐ"Ð"Ý˜,­Ñ-Ô-ð å!ØØØ Ø Ø"ØØØØØØñô �ð �
å*ØØØ Ø Ø"ØØØØØØñô �ð �
å˜,­Ñ-Ô-ð Ý Ô,ð*ñô ð õ �<Ñ Ô  1Ò$Ð$Ý Ô,ð/ñô ð õ ˜k­4Ñ0Ô0ð Ý Ô,ØEñô ð õ $ØØØØØØØØØØØñô ˆCð ˆJr&   )r'   r(   )r'   )r'   T)
NNNFNTFrÁ   rÂ   rÃ   )Únumbersr   Úplotlyr   r   Úplotly.colorsrœ   r°   Úplotly.graph_objsr   Úplotly.subplotsr   Ú
get_modulerÐ   r   ru   r%   rG   rQ   rU   rX   r\   rj   rq   r€   r§   r¾   rÀ   rÙ   © r&   r$   ú<module>rá      s²  ðØ Ð Ð Ð Ð Ð à /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ø Ð Ð Ð Ð Ð Ø (Ð (Ð (Ð (Ð (Ð (Ø )Ð )Ð )Ð )Ð )Ð )à ÐÔ  Ñ*Ô*€Ø ÐÔ  Ñ)Ô)€Ø)ÐÔ)¨-Ñ8Ô8€ðð ð ð8ð ð ð ð.ð ð ð ð
ð 
ð 
ðð ð ð"ð ð ðð ð ð"ð ð ð"$"ð $"ð $"ð $"ðN@ð @ð @ðFdð dð dðNEð Eð EðT ØØØØØØ	ØØ
Ø
ðPð Pð Pð Pð Pð Pr&   