
    Lem                         d dl Z ddlmZ ddlmZ ddlmZmZ ddlm	Z	  G d d	ee          Z
 G d
 de          Z G d dee          Z G d de          Z G d de          ZdS )    N   )MultiDistributionMixin   )	ChartPlot)ColorbarPlotElementPlot)PlotlyOverlaySelectionDisplayc                        e Zd Z ej        d          Z ej        d          Zg dZdZ	 e
            Zedd            Z fdZ xZS )	BivariatePlotF)defaultN)visiblecmap
showlabels	labelfontlabelformat	showlinescontoursc                 
    ddiS )Ntypehistogram2dcontour clsis_geokwargss      ?lib/python3.11/site-packages/holoviews/plotting/plotly/stats.pytrace_kwargszBivariatePlot.trace_kwargs   s    ,--    c                     t                      j        |||fi |}|                     |j        d         |||          }| j        rd|d<   | j        |d<   ddi|d<   | j        rdnd	|                    d
d          d|d<   |d         |d<   d|v r|d         |d<   |                    dd          |d<   |                    dd          |d<   |S )Nr   Fautocontour	ncontourswidthr   linefilllinesr   T)coloringr   r   
colorscalecolorbar	showscaler   )supergraph_optionsget_color_optsvdimsr!   filledget)selfelementrangesstyler   optscopts	__class__s          r   r+   zBivariatePlot.graph_options   s	   $uww$WfeFFvFF##GM!$4gvuMM> 	/"'D $D  |V #'+:7;55
 
Z #<0\ $Z0D!IIk599[  ))It44Yr   F)__name__
__module____qualname__paramBooleanr.   Integerr!   
style_opts
_style_keyr	   selection_displayclassmethodr   r+   __classcell__r6   s   @r   r   r   	   s        U]5)))Fd+++I[[[JJ5577. . . [.        r   r   c                       e Zd Z ej        dd          Z ej        dd          Z ej        dd          Zg dZ	d	Z
 e            Zedd            ZdS )DistributionPlotNz>
        The bandwidth of the kernel for the density estimate.r   doc   zD
        Draw the estimate to cut * bw from the extreme data points.Tz9
        Whether the bivariate contours should be filled.)r   colordash
line_widthr#   Fc                     dddS )Nscatterr%   )r   moder   r   s      r   r   zDistributionPlot.trace_kwargsJ   s    !7333r   r7   )r8   r9   r:   r;   Number	bandwidthcutr<   r.   r>   r?   r	   r@   rA   r   r   r   r   rE   rE   9   s        T 0A B B BI %,q 'G H H HC U]4 .< = = =F <;;JJ55774 4 4 [4 4 4r   rE   c                       e Zd Zd ZdS )MultiDistributionPlotc                    |j         r-|                    |j                                                   }n
|j        |fg}g }| j        rdnd}|D ]z\  }}	|j         r3d                    d t          |j         |          D                       }
n|}
||	                    |	j        d                   d|
i}|	                    |           {|S )Nxy,c                 >    g | ]\  }}|                     |          S r   )pprint_value).0dvs      r   
<listcomp>z2MultiDistributionPlot.get_data.<locals>.<listcomp>Z   s(    !X!X!X1!.."3"3!X!X!Xr   r   name)
kdimsgroupbyitemslabelinvert_axesjoinzipdimension_valuesr-   append)r0   r1   r2   r3   r   groupsplotsaxiskeygrouprb   datas               r   get_datazMultiDistributionPlot.get_dataQ   s    = 	0__W]3399;;FF}g./F&/ssC  	 	JC} !X!XGMSV@W@W!X!X!XYY%00Q@@&%PDLLr   N)r8   r9   r:   rn   r   r   r   rS   rS   O   s#            r   rS   c                        e Zd Z ej        g ddd          Z ej        dd          Z ej        dg d	d
          Zg dZ	dZ
 e            Zedd            Z fdZ xZS )BoxWhiskerPlot)alloutlierssuspectedoutliersFrr   zi
        Which points to show, valid options are 'all', 'outliers',
        'suspectedoutliers' and False)objectsr   rG   r   z
        Sets the amount of jitter in the sample points drawn. If "0",
        the sample points align along the distribution axis. If "1",
        the sample points are drawn in a random jitter of width equal
        to the width of the box(es).rF   F)TFsd
        If "True", the mean of the box(es)' underlying distribution
        is drawn as a dashed line inside the box(es). If "sd" the
        standard deviation is also drawn.)r   rt   rG   r   rI   alphaoutliercolormarkersizerz   c                 
    ddiS )Nr   boxr   r   s      r   r   zBoxWhiskerPlot.trace_kwargs}   s    r   c                 h     t                      j        |||fi |}| j        |d<   | j        |d<   |S )Nboxmeanjitter)r*   r+   meanr   r0   r1   r2   r3   r   optionsr6   s         r   r+   zBoxWhiskerPlot.graph_options   sB    '%'''II&II!Y	 Kr   r7   )r8   r9   r:   r;   ObjectSelector	boxpointsrO   r   r   r>   r?   r	   r@   rA   r   r+   rB   rC   s   @r   rp   rp   c   s        $$ .J .J .J-7 >)* * *I U\! *( ) ) )F  57J7J7J%-. . .D QPPJJ5577   [        r   rp   c                        e Zd Z ej        dd          Z ej        dd          Zg dZdZe	d
d            Z
 fd	Z xZS )
ViolinPlotTz4
        Whether to draw a boxplot inside the violinrF   Frv   rw   rz   c                 
    ddiS )Nr   violinr   r   s      r   r   zViolinPlot.trace_kwargs   s    !!r   c                 p     t                      j        |||fi |}d| j        i|d<   d| j        i|d<   |S )Nr   meanliner}   )r*   r+   r   r}   r   s         r   r+   zViolinPlot.graph_options   sW    '%'''VU
 
&,
 
  )$-8
#TX.r   r7   )r8   r9   r:   r;   r<   r}   r   r>   r?   rA   r   r+   rB   rC   s   @r   r   r      s        
%- +7 8 8 8C u}U 1- . . .H
 QPPJJ" " " ["        r   r   )r;   mixinsr   chartr   r1   r   r   	selectionr	   r   rE   rS   rp   r   r   r   r   <module>r      sA    + + + + + +       . . . . . . . . 4 4 4 4 4 4- - - - -I| - - -`4 4 4 4 4{ 4 4 4,    2K   (" " " " "* " " "J    &     r   