
    e                     >   d dl Zd dlmZ d dlZd dlZd dl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 d dlmZmZmZ d dlmZ d dlmZmZmZmZmZ 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*m+Z+  G d de(e*          Z, G d de(e*          Z- G d de*          Z.dS )    N)SkipTest)Document)EqHistColorMapperFixedTickerLinearColorMapperLogColorMapper	LogTickerNumeralTickFormatterPrintfTickFormattertools)
DynamicMapHoloMap	NdOverlay)	dt_to_int)CurveHeatMapImageLabelsScatter)process_cmap)	PointDrawStream)render   )LoggingComparisonTestCase   )TestBokehPlotbokeh_rendererc                      e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&d% Z'd& Z(d' Z)d( Z*d) Z+d* Z,d+ Z-d, Z.d- Z/d. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6d5 Z7d6 Z8d7 Z9d8 Z:d9 Z;d: Z<d; Z=d< Z>d= Z?d> Z@d? ZAd@ ZBdA ZCdB ZDdC ZEdD ZFdE ZGdF ZHdG ZIdH ZJdI ZKdJ ZLdK ZMdL ZNdM ZOdN ZPdO ZQdP ZRdQ ZSdR ZTdS ZUdT ZVdU ZWdVS )WTestElementPlotc                     t          t          d                                        d          }t          j        |          j        }|                     |j        d           d S )N
   F)
show_framer   )r   rangeoptsr   get_plotstateassertEqualoutline_line_alphaselfcurveplots      Olib/python3.11/site-packages/holoviews/tests/plotting/bokeh/test_elementplot.py test_element_show_frame_disabledz0TestElementPlot.test_element_show_frame_disabled    sX    eBii  %%%77&u--30!44444    c                    t          t          d                                        dd          }t          j        |          }|j        }|j        d         }|j        d         }|                     |j        j	        d           |                     |j
        d           |                     |j
        d           |                     |j        d	           |                     |j        d	           d S )
Nr"      A title)	fontscaletitlexaxisyaxis24pt26px22pxr   r$   r%   r   r&   r'   handlesr(   r5   text_font_sizeaxis_label_text_font_sizemajor_label_text_font_sizer+   r,   r-   figr6   r7   s         r.   test_element_font_scalingz)TestElementPlot.test_element_font_scaling%   s    eBii  %%%CC&u--jW%W%16:::8&AAA8&AAA96BBB96BBBBBr0   c                    t          t          d                                        ddd          }t          j        |          }|j        }|j        d         }|j        d         }|                     |j        j	        d           |                     |j
        d           |                     |j
        d           |                     |j        d	           |                     |j        d	           d S )
Nr"   r2   14ptr3   r4   fontsizer5   r6   r7   28ptr:   r;   r@   s         r.   2test_element_font_scaling_fontsize_override_commonzBTestElementPlot.test_element_font_scaling_fontsize_override_common1   s    eBii  %%F)%TT&u--jW%W%16:::8&AAA8&AAA96BBB96BBBBBr0   c                    t          t          d                                        dddddd          }t          j        |          }|j        }|j        d	         }|j        d
         }|                     |j        j	        d           |                     |j
        d           |                     |j        d           |                     |j
        d           |                     |j        d           d S )Nr"   r2   z100%12ptz1.2em)r5   xlabelxticksr3   rE   r6   r7   z200%r8   z2.4emr9   r:   r;   r@   s         r.   4test_element_font_scaling_fontsize_override_specificzDTestElementPlot.test_element_font_scaling_fontsize_override_specific=   s    eBii  %%FfPW"X"X &   &u--jW%W%16:::8&AAA97CCC8&AAA96BBBBBr0   c                     t          t          d                                        d          }t          j        |          }|j        d         }|                     ||j        j        v            d S )Nr"   topr6   r6   )	r   r$   r%   r   r&   r<   
assertTruer'   abover+   r,   r-   r6   s       r.   test_element_xaxis_topz&TestElementPlot.test_element_xaxis_topK   sd    eBii  %%E%22&u--W%!1122222r0   c                    t          t          d                                        d          }t          j        |          }|j        d         }|                     |j        d           |                     |j        d           |                     |j	        d            |                     |j
        d            |                     ||j        j        v            d S )Nr"   barerP   r6   0ptr   r$   r%   r   r&   r<   r(   r>   r?   minor_tick_line_colormajor_tick_line_colorrQ   r'   belowrS   s       r.   test_element_xaxis_barez'TestElementPlot.test_element_xaxis_bareQ   s    eBii  %%F%33&u--W%8%@@@95AAA4d;;;4d;;;!1122222r0   c                    t          t          d                                        d          }t          j        |          }|j        d         }|                     |j        d           |                     |j        d           |                     |j	        d            |                     |j
        d            |                     ||j        j        v            d S )Nr"   zbottom-barerP   r6   rW   rX   rS   s       r.   test_element_xaxis_bottom_barez.TestElementPlot.test_element_xaxis_bottom_bare[   s    eBii  %%M%::&u--W%8%@@@95AAA4d;;;4d;;;!1122222r0   c                    t          t          d                                        d          }t          j        |          }|j        d         }|                     |j        d           |                     |j        d           |                     |j	        d            |                     |j
        d            |                     ||j        j        v            d S )Nr"   ztop-barerP   r6   rW   )r   r$   r%   r   r&   r<   r(   r>   r?   rY   rZ   rQ   r'   rR   rS   s       r.   test_element_xaxis_top_barez+TestElementPlot.test_element_xaxis_top_baree   s    eBii  %%J%77&u--W%8%@@@95AAA4d;;;4d;;;!1122222r0   c                     t          t          d                                        d          }t          j        |          }|j        d         }|                     ||j        j        v            d S )Nr"   rightr7   r7   )	r   r$   r%   r   r&   r<   rQ   r'   rb   r+   r,   r-   r7   s       r.   test_element_yaxis_rightz(TestElementPlot.test_element_yaxis_righto   sd    eBii  %%G%44&u--W%!1122222r0   c                    t          t          d                                        d          }t          j        |          }|j        d         }|                     |j        d           |                     |j        d           |                     |j	        d            |                     |j
        d            |                     ||j        j        v            d S )Nr"   rV   rc   r7   rW   r   r$   r%   r   r&   r<   r(   r>   r?   rY   rZ   rQ   r'   leftrd   s       r.   test_element_yaxis_barez'TestElementPlot.test_element_yaxis_bareu   s    eBii  %%F%33&u--W%8%@@@95AAA4d;;;4d;;;011111r0   c                    t          t          d                                        d          }t          j        |          }|j        d         }|                     |j        d           |                     |j        d           |                     |j	        d            |                     |j
        d            |                     ||j        j        v            d S )Nr"   z	left-barerc   r7   rW   rg   rd   s       r.   test_element_yaxis_left_barez,TestElementPlot.test_element_yaxis_left_bare   s    eBii  %%K%88&u--W%8%@@@95AAA4d;;;4d;;;011111r0   c                    t          t          d                                        d          }t          j        |          }|j        d         }|                     |j        d           |                     |j        d           |                     |j	        d            |                     |j
        d            |                     ||j        j        v            d S )Nr"   z
right-barerc   r7   rW   )r   r$   r%   r   r&   r<   r(   r>   r?   rY   rZ   rQ   r'   rb   rd   s       r.   test_element_yaxis_right_barez-TestElementPlot.test_element_yaxis_right_bare   s    eBii  %%L%99&u--W%8%@@@95AAA4d;;;4d;;;!1122222r0   c                     d}t          g dd                              |          }d}|                     t          |          j        j        |           d S )Nz@Label: {label}, group: {group}, dims: {dimensions}, type: {type}	the_label	the_group)labelgroup)r5   z9Label: the_label, group: the_group, dims: , type: Scatter)r   r%   r(   r   r5   text)r+   	title_strer5   s       r.   test_element_title_formatz)TestElementPlot.test_element_title_format   si    8	
 
 
 $Y$

	 	

 L-u55555r0   c                     d }t          t          d          d                              |g          }t          j        |          }|                     |j        j        j        d           d S )Nc                 4    d| j         d         j        _        d S )NCalledr-   )r<   r5   rs   )r-   elements     r.   hookz0TestElementPlot.test_element_hooks.<locals>.hook   s    .6DL &+++r0   r"   z
Not Calledrq   )hooksry   )	r   r$   r%   r   r&   r(   r'   r5   rs   )r+   r{   r,   r-   s       r.   test_element_hooksz"TestElementPlot.test_element_hooks   sp    	7 	7 	7eBii|444999GG&u--).99999r0   c                 R   t           j                            d          }t          g           j                            |          }t          j        |          }|j        d         j	        sJ d|_
        |j        d         j	        rJ d|_
        |j        d         j	        sJ d S )NT)value)visibleglyph_rendererF)pnwidgetsCheckboxr   applyr%   r   r&   r<   r   r   )r+   checkboxscatterr-   s       r.   test_element_update_visiblez+TestElementPlot.test_element_update_visible   s    :&&T&22"++#(((::&w//|,-5555< 019999|,-555555r0   c                 (   t          t          d                                        d          }t          j        |          }|j        d         }|                     |j        t                     | 	                    |j        j
        d           d S )Nr"   %d
xformatterr6   r   r$   r%   r   r&   r<   assertIsInstance	formatterr   r(   formatrS   s       r.   test_element_xformatter_stringz.TestElementPlot.test_element_xformatter_string   |    eBii  %%%66&u--W%eo/BCCC/66666r0   c                 (   t          t          d                                        d          }t          j        |          }|j        d         }|                     |j        t                     | 	                    |j        j
        d           d S )Nr"   r   
yformatterr7   r   rd   s       r.   test_element_yformatter_stringz.TestElementPlot.test_element_yformatter_string   r   r0   c                     t                      }t          t          d                                        |          }t	          j        |          }|j        d         }|                     |j        |           d S )Nr"   r   r6   	r
   r   r$   r%   r   r&   r<   assertIsr   )r+   r   r,   r-   r6   s        r.    test_element_xformatter_instancez0TestElementPlot.test_element_xformatter_instance   i    (**	eBii  %%%;;&u--W%eoy11111r0   c                     t                      }t          t          d                                        |          }t	          j        |          }|j        d         }|                     |j        |           d S )Nr"   r   r7   r   )r+   r   r,   r-   r7   s        r.    test_element_yformatter_instancez0TestElementPlot.test_element_yformatter_instance   r   r0   c                     t          g           }t          j        |          }|                     |j        d         j                   d S )Nr   )r   r   r&   rQ   r<   r   r*   s      r.   test_empty_element_visibilityz-TestElementPlot.test_empty_element_visibility   s@    b		&u--%56>?????r0   c                     t          t          d                                        d           }t          j        |          j        }|                     |j        d         j                   d S )Nr"   rP   r   )	r   r$   r%   r   r&   r'   assertFalser6   r   r*   s      r.   test_element_no_xaxisz%TestElementPlot.test_element_no_xaxis   \    eBii  %%D%11&u--3A./////r0   c                     t          t          d                                        d           }t          j        |          j        }|                     |j        d         j                   d S )Nr"   rc   r   )	r   r$   r%   r   r&   r'   r   r7   r   r*   s      r.   test_element_no_yaxisz%TestElementPlot.test_element_no_yaxis   r   r0   c                     t          t          d                                        d          }t          j        |          j        }|                     |j        d         j        t          j
        dz             d S )Nr"   Z   )	xrotationr   r2   )r   r$   r%   r   r&   r'   r(   r6   major_label_orientationnppir*   s      r.   test_element_xrotationz&TestElementPlot.test_element_xrotation   d    eBii  %%%33&u--3A>aHHHHHr0   c                     t          t          d                                        d          }t          j        |          j        }|                     |j        d         j        t          j
        dz             d S )Nr"   r   )	yrotationr   r2   )r   r$   r%   r   r&   r'   r(   r7   r   r   r   r*   s      r.   test_element_yrotationz&TestElementPlot.test_element_yrotation   r   r0   c                     t          t          d                                        d          }t          j        |          j        }|                     |j        d         j        d           d S )Nr"   zcustom x-label)rK   r   )	r   r$   r%   r   r&   r'   r(   r6   
axis_labelr*   s      r.   test_element_xlabel_overridez,TestElementPlot.test_element_xlabel_override   `    eBii  %%-=%>>&u--3A13CDDDDDr0   c                     t          t          d                                        d          }t          j        |          j        }|                     |j        d         j        d           d S )Nr"   zcustom y-label)ylabelr   )	r   r$   r%   r   r&   r'   r(   r7   r   r*   s      r.   test_element_ylabel_overridez,TestElementPlot.test_element_ylabel_override   r   r0   c                 2   t          t          d                                        dg          }t          j        |          j        }|                     |j        d         j        d           |                     |j	        d         j        d           d S )Nr"   ylabelledr    
r   r$   r%   r   r&   r'   r(   r6   r   r7   r*   s      r.    test_element_labelled_x_disabledz0TestElementPlot.test_element_labelled_x_disabled   s    eBii  %%u%55&u--3A12666A1377777r0   c                 2   t          t          d                                        dg          }t          j        |          j        }|                     |j        d         j        d           |                     |j	        d         j        d           d S )Nr"   xr   r   r   r   r*   s      r.    test_element_labelled_y_disabledz0TestElementPlot.test_element_labelled_y_disabled   s    eBii  %%u%55&u--3A13777A1266666r0   c                 0   t          t          d                                        g           }t          j        |          j        }|                     |j        d         j        d           |                     |j	        d         j        d           d S )Nr"   r   r   r   r   r*   s      r.   #test_element_labelled_both_disabledz3TestElementPlot.test_element_labelled_both_disabled   s}    eBii  %%r%22&u--3A12666A1266666r0   c                    t          j        d          }t          |          fd|_         t	          j        dd                      }t          |g          }t          j        |t                                }|j
        d         }|                     |j        d	         d
                                         d           |                    d           |                     |j                   |                     |j        d	         d
                                         d           |                     ||j                   d S )N)   r   c                 (    xj         | z  c_         S N)data)testget_imgimgs    r.   r   z@TestElementPlot.test_static_source_optimization.<locals>.get_img  s    LLD LLJr0   Testr   r   streams)docsourceimager   r2   )r   onesr   r   r   definer   r   r&   r   r<   r(   meaneventrQ   static_sourceassertNotIncurrent_handles)r+   r   streamdmapr-   r   r   r   s         @@r.   test_static_source_optimizationz/TestElementPlot.test_static_source_optimization   s<   wvDkk	 	 	 	 	 	 .vA...00'F8444&t<<<h'W-a05577;;;!*+++W-a05577;;;!566666r0   c                 T    t          j        dd                      }t          d |g          }t          j        |          }|                     t          |j                             |                                 | 	                    t          |j                             d S )Nr   r   r   c                      t          g           S r   )r   r   s    r.   <lambda>z5TestElementPlot.test_stream_cleanup.<locals>.<lambda>  s    uRyy r0   r   )
r   r   r   r   r&   rQ   bool_subscriberscleanupr   )r+   r   r   r-   s       r.   test_stream_cleanupz#TestElementPlot.test_stream_cleanup  s    .vA...00006(CCC&t,,V011222f12233333r0   c                 J   d t          dd          D             }t          j        dddd          }t          |                              |g          }t          j        |          }|                     |j        j	        j
        j        t          |d          g           d S )Nc                 >    g | ]}t          j        d d|          |fS   r   dtdatetime.0is     r.   
<listcomp>z@TestElementPlot.test_element_xticks_datetime.<locals>.<listcomp>  +    CCC!"+dAq))1-CCCr0   r      r      rL   ms)r$   r   r   r   r%   r   r&   r(   r'   r6   tickerticksr   r+   datestickr,   r-   s        r.   test_element_xticks_datetimez,TestElementPlot.test_element_xticks_datetime  s    CCuQ{{CCC{4Ar**e!!$!00&u--)0649N9N8OPPPPPr0   c                    d t          dd          D             }t          j        dddd          }t          |                              |dfg          }t          j        |          }|                     |j        j	        j
        j        t          |d          g           |                     |j        j	        j        t          |d          di           d S )	Nc                 >    g | ]}t          j        d d|          |fS r   r   r   s     r.   r   zOTestElementPlot.test_element_xticks_datetime_label_override.<locals>.<listcomp>$  r   r0   r   r   r   r   Ar   r   )r$   r   r   r   r%   r   r&   r(   r'   r6   r   r   r   major_label_overridesr   s        r.   +test_element_xticks_datetime_label_overridez;TestElementPlot.test_element_xticks_datetime_label_override#  s    CCuQ{{CCC{4Ar**e!!4+!77&u--)0649N9N8OPPP)?)DRVBWBWY\A]^^^^^r0   c                     t          g d                              ddgd          }t          j        |          }|                     |j        j        d         j        |j        j        d         j                   d S )Nr   r2   r         ?      ?T)rL   	show_gridr   )	r   r%   r   r&   r   r'   xgridr   r6   r*   s      r.    test_element_grid_custom_xtickerz0TestElementPlot.test_element_grid_custom_xticker+  n    iii  %%c3Z4%HH&u--dj&q)0$*2B12E2LMMMMMr0   c                     t          g d                              ddgd          }t          j        |          }|                     |j        j        d         j        |j        j        d         j                   d S )Nr  r  g      @T)yticksr  r   )	r   r%   r   r&   r   r'   ygridr   r7   r*   s      r.    test_element_grid_custom_ytickerz0TestElementPlot.test_element_grid_custom_yticker0  r  r0   c                    ddddddgd}t          t          d                                        d|	          }t          j        |          }|                     |j        j        d
         j        d           |                     |j        j        d
         j	        d           |                     |j        j        d
         j
        ddg           |                     |j        j        d
         j        d           |                     |j        j        d
         j        d           |                     |j        j        d
         j	        d           |                     |j        j        d
         j        d           d S )Nbluer  )g333333?gffffff?	lightgrayr   )grid_line_colorgrid_line_widthygrid_boundsminor_xgrid_line_colorxgrid_line_dashr"   T)r  	gridstyler   )r   r$   r%   r   r&   r(   r'   r  r  r  grid_line_dashminor_grid_line_colorr
  bounds)r+   
grid_styler,   r-   s       r.   test_element_grid_optionsz)TestElementPlot.test_element_grid_options5  sY   )/CYc0;QRTUPVX X
eBii  %%
%KK&u--)!,<fEEE)!,<cBBB)!,;aVDDD)!,BKPPP)!,<fEEE)!,<cBBB)!,3Z@@@@@r0   c                    ddddt          fddg          j                            g d          }t          j        |          }|                     t          |j        d	         j        	                                          dd
g           |                     |j
        j        d         j        d           |                    d           |                     t          |j        d	         j        	                                          dd
g           |                     |j
        j        d         j        d           d S )Nr   r2   r   abcc                 J    t          t          |                    |           S r   r   r$   )r  lengthss    r.   r   z9TestElementPlot.test_change_cds_columns.<locals>.<lambda>D  s    U5+<+<a%@%@ r0   r  kdimsr  r   r   r   r  r  r   redimvaluesr   r&   r(   sortedr<   r   keysr'   r6   r   update)r+   r,   r-   r!  s      @r.   test_change_cds_columnsz'TestElementPlot.test_change_cds_columnsB  s)   **@@@@NNNT[[^m^m^m[nn&u--X 6 ; @ @ B BCCc3ZPPP)!,7===FX 6 ; @ @ B BCCc3ZPPP)!,7=====r0   c                 |   t          d dg          j                            g d          }t          j        |          }|                     t          |j        d         j        	                                          ddg           |                     |j
        j        d         j        d           |                    d	           |                     t          |j        d         j        	                                          g d
           |                     |j
        j        d         j        d           d S )Nc                 <    t          t          d          |           S )Nr"   r   r$  s    r.   r   z9TestElementPlot.test_update_cds_columns.<locals>.<lambda>M  s    U599a%8%8 r0   r  r"  r  r$  r   r   r   r%  )r  r  r   r  r&  r*   s      r.   test_update_cds_columnsz'TestElementPlot.test_update_cds_columnsL  s   88FFFLSSVeVeVeSff&u--X 6 ; @ @ B BCCc3ZPPP)!,7===FX 6 ; @ @ B BCC___UUU)!,7=====r0   c                    t          ddg                              ddd          }t          j        |          }|j        d         }|                     |j        d           |                     |j        d           d S )	Nr   r   Br2   6pt   )minor_xticksrL   rF   r6   18ptr   r%   r   r&   r<   r(   r?   group_text_font_sizerS   s       r.   test_categorical_axis_fontsizez.TestElementPlot.test_categorical_axis_fontsizeU  s    x*++005\^:_:_0``&u--W%95AAA3V<<<<<r0   c                    t          ddg                              ddi          }t          j        |          }|j        d         }|                     |j        d           |                     |j        d           d S )Nr1  r2  rL   r5  r7  r6   r8  r9  rS   s       r.   #test_categorical_axis_fontsize_bothz3TestElementPlot.test_categorical_axis_fontsize_both\  s}    x*++008R.0II&u--W%96BBB3V<<<<<r0   c                    	 dd l }n# t          $ r t          d          w xY w|                    ddd          |                    ddd          |                    ddd          g}t	          |g df          }t          j        |          }|j        d	         j        d
         }| 	                    |
                    d          t          j        g d                     d S )Nr   Test requires cftime library  r2      r   r   r  cdsr   int64l    +vl    <?vl    Iv)cftimeImportErrorr   DatetimeGregorianr   r   r&   r<   r   r(   astyper   array)r+   rE  gregorian_datesr,   r-   xss         r.   'test_cftime_transform_gregorian_no_warnz7TestElementPlot.test_cftime_transform_gregorian_no_warnc  s   	;MMMM 	; 	; 	;9:::	;!33D!R@@!33D!Q??!33D!Q??A 			233&u--\% %c*7++"L"L"LMM	O 	O 	O 	O 	O    !c                    	 dd l }n# t          $ r t          d          w xY w|                    ddd          |                    ddd          |                    ddd          g}t	          |g df          }t          j        |          }|j        d	         j        d
         }| 	                    |
                    d          t          j        g d                     d}| j                            d|           d S )Nr   r?  r@  r2   rA  r   r   r  rB  r   rC  rD  zConverting cftime.datetime from a non-standard calendar (noleap) to a standard calendar for plotting. This may lead to subtle errors in formatting dates, for accurate tick formatting switch to the matplotlib backend.WARNING)rE  rF  r   DatetimeNoLeapr   r   r&   r<   r   r(   rH  r   rI  log_handlerassertEndsWith)r+   rE  rJ  r,   r-   rK  substrs          r.   !test_cftime_transform_noleap_warnz1TestElementPlot.test_cftime_transform_noleap_warnq  s'   	;MMMM 	; 	; 	;9:::	;!00q"==!00q!<<!00q!<<> 			233&u--\% %c*7++"L"L"LMM	O 	O 	O@ 	
 	''	6:::::rM  c                     t          g d                              dg          }t          j        |          }|j        j        }|                     |j        t          j	                   d S Nr  box_zoomactive_tools)
r   r%   r   r&   r'   toolbarr   active_dragr   BoxZoomToolr+   r,   r-   rZ  s       r.   test_active_tools_dragz&TestElementPlot.test_active_tools_drag  sb    iii  %%J<%@@&u--*$g153DEEEEEr0   c                     t          g d                              dg          }t          j        |          }|j        j        }|                     |j        t          j	                   d S Nr  
wheel_zoomrX  )
r   r%   r   r&   r'   rZ  r   active_scrollr   WheelZoomToolr]  s       r.   test_active_tools_scrollz(TestElementPlot.test_active_tools_scroll  sb    iii  %%L>%BB&u--*$g3U5HIIIIIr0   c                     t          g d                              dgdg          }t          j        |          }|j        j        }|                     |j        t          j	                   d S )Nr  tap)rY  r   )
r   r%   r   r&   r'   rZ  r   
active_tapr   TapToolr]  s       r.   test_active_tools_tapz%TestElementPlot.test_active_tools_tap  se    iii  %%E75'%JJ&u--*$g0%-@@@@@r0   c                 F   t          g d                              dg          }t          |           t          j        |          }|j        j        }|                     |j        t          j
                   |                     |j        t          j
                   d S Nr  
point_drawrX  )r   )r   r%   r   r   r&   r'   rZ  r   rg  r   PointDrawToolr[  )r+   r   r-   rZ  s       r.   test_active_tools_draw_streamz-TestElementPlot.test_active_tools_draw_stream  s    )))$$))~)FF!!!!&w//*$g0%2EFFFg153FGGGGGr0   c                    t          t          g dd          t          g dd          d                              dg          }t          j        |          }|                     |j        d         j        dd	g           |                    d
           |                     |j        d         j        ddg           d S )Nr  r  vdimsr  )r  r  hoverr   )r   z@{x})r  z@{a}r%  )r  z@{b})	r   r   r%   r   r&   r(   r<   tooltipsr+  )r+   hmapr-   s      r.   test_hover_tooltip_updatez)TestElementPlot.test_hover_tooltip_update  s    U999C888uYYYVY?Z?Z?Z[[\\aa) b  &t,,g.7-9WXXXFg.7-9WXXXXXr0   c                     t          ddg          j                            g d          }t          j        |          }|j        d         }|                     |j        g d           d S )NCr   r3  r   r   r3  ry  r   x_range)r   r'  r(  r   r&   r<   r(   factorsr+   r,   r-   r}  s       r.   !test_categorical_dimension_valuesz1TestElementPlot.test_categorical_dimension_values  sj    x*++188???8KK&u--,y)///:::::r0   c                     t          g           j                            t                    }t	          j        |          }|j        d         }|                     |j        g            d S )Nr|  r}  )	r   r'  typestrr   r&   r<   r(   r~  r  s       r.   test_categorical_dimension_typez/TestElementPlot.test_categorical_dimension_type  sZ    b		$$s$++&u--,y)"-----r0   c                    t          g d                              d          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d            d S )Nr  r2   )aspect,  iX  r   r%   r   r&   r(   r'   heightwidthframe_heightframe_widthaspect_ratior*   s      r.   test_element_aspectz#TestElementPlot.test_element_aspect  s    iii  %%Q%//&u--*D111)40000#666/5550$77777r0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d            | j                            dd           d S )Nr  r2     )r  r     rO  5uses those values as frame_width/frame_height insteadr   r%   r   r&   r(   r'   r  r  r  r  r  rQ  assertContainsr*   s      r.   test_element_aspect_widthz)TestElementPlot.test_element_aspect_width  s    iii  %%Qc%::&u--*D111)40000#666/5550$777''	3jkkkkkr0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d            | j                            dd           d S )Nr  r2   r  )r  r     rO  r  r  r*   s      r.   test_element_aspect_heightz*TestElementPlot.test_element_aspect_height  s    iii  %%Qs%;;&u--*D111)40000#666/5550$777''	3jkkkkkr0   c                    t          g d                              ddd          }t          j        |          }|                     |j        j        d           |                     |j        j        d           |                     |j        j        d            |                     |j        j	        d            |                     |j        j
        d            | j                            dd           d S )Nr  r2   r  )r  r  r  rO  aspect value was ignoredr  r*   s      r.    test_element_aspect_width_heightz0TestElementPlot.test_element_aspect_width_height  s    iii  %%Qs#%FF&u--*C000)3///0$777/6660$777''	3MNNNNNr0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d            d S )Nr  r2   r  )r  r  r  r  r*   s      r.   test_element_aspect_frame_widthz/TestElementPlot.test_element_aspect_frame_width  s    iii  %%QC%@@&u--*D111)40000#666/5550$77777r0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d            d S )Nr  r2   r  )r  r  r  r  r*   s      r.    test_element_aspect_frame_heightz0TestElementPlot.test_element_aspect_frame_height  s    iii  %%QS%AA&u--*D111)40000#666/5550$77777r0   c                    t          g d                              ddd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d            | j                            dd           d S )Nr  r2   r  )r  r  r  rO  r  r  r*   s      r.   ,test_element_aspect_frame_width_frame_heightz<TestElementPlot.test_element_aspect_frame_width_frame_height  s    iii  %%QSc%RR&u--*D111)40000#666/5550$777''	3MNNNNNr0   c                    t          g d                              d          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d           d S )Nr   r  r   r  r  )data_aspectr  r  r   r%   r   r&   r(   r'   r  r  r  r  aspect_scaler*   s      r.   test_element_data_aspectz(TestElementPlot.test_element_data_aspect  s    &&&'',,,==&u--*D111)40000#666/5550#66666r0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d           | j                            dd           d S )Nr  r2   r  )r  r  rO  r  r   r%   r   r&   r(   r'   r  r  r  r  r  rQ  r  r*   s      r.   test_element_data_aspect_widthz.TestElementPlot.test_element_data_aspect_width  s    &&&'',,#,FF&u--*D111)40000#666/5550!444''	3jkkkkkr0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d           | j                            dd           d S )Nr  r2   r  )r  r  rO  r  r  r*   s      r.   test_element_data_aspect_heightz/TestElementPlot.test_element_data_aspect_height  s    &&&'',,3,GG&u--*D111)40000#666/5550!444''	3jkkkkkr0   c                 H   t          g d                              ddd          }t          j        |          }|j        d         |j        d         }}|                     |j        j        d           |                     |j        j        d           |                     |j        j	        d           |                     |j
        d           |                     |j        d           |                     |j
        d	           |                     |j        d
           d S )N)r   r2   r   r2   r  )r  r  r  r}  y_ranger   r   r   )r   r%   r   r&   r<   r(   r'   r  r  r  startendr+   r,   r-   r}  r  s        r.   %test_element_data_aspect_width_heightz5TestElementPlot.test_element_data_aspect_width_height  s   iii  %%!Cs%KK&u--<	2DL4K*C000)3///0!444+++a(((***a(((((r0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d           d S )Nr  r2   r  )r  r  r  r  r*   s      r.   $test_element_data_aspect_frame_widthz4TestElementPlot.test_element_data_aspect_frame_width#  s    iii  %%!%EE&u--*D111)40000#666/5550!44444r0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d           d S )Nr  r2   r  )r  r  r  r  r*   s      r.   %test_element_data_aspect_frame_heightz5TestElementPlot.test_element_data_aspect_frame_height,  s    iii  %%!#%FF&u--*D111)40000#666/5550!44444r0   c                    t          g d                              ddd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d           |                     |j        j
        d           d S )Nr  r2   r  )r  r  r  r  r*   s      r.   1test_element_data_aspect_frame_width_frame_heightzATestElementPlot.test_element_data_aspect_frame_width_frame_height5  s    iii  %%!#SV%WW&u--*D111)40000#666/5550!44444r0   c                    t          g d                              d          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d            |                     |j        j	        d            |                     |j        j
        d           d S )Nr  T)
responsivestretch_bothr   r%   r   r&   r(   r'   r  r  r  r  sizing_moder*   s      r.   test_element_responsivez'TestElementPlot.test_element_responsiveB  s    iii  %%%66&u--*D111)40000$777/666/@@@@@r0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d           |                     |j        j        d            |                     |j        j	        d            |                     |j        j
        d           d S )Nr  r  T)r  r  stretch_heightr  r*   s      r.   test_element_width_responsivez-TestElementPlot.test_element_width_responsiveK  s    iii  %%CD%AA&u--*D111)3///0$777/666/1ABBBBBr0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d           |                     |j        j        d            |                     |j        j        d            |                     |j        j	        d            |                     |j        j
        d           d S )Nr  r  T)r  r  stretch_widthr  r*   s      r.   test_element_height_responsivez.TestElementPlot.test_element_height_responsiveT  s    iii  %%ST%BB&u--*C000)40000$777/666/AAAAAr0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d            |                     |j        j	        d           |                     |j        j
        d           d S )Nr  r  T)r  r  r  r  r*   s      r.   #test_element_frame_width_responsivez3TestElementPlot.test_element_frame_width_responsive]  s    iii  %%#$%GG&u--*D111)40000$777/555/1ABBBBBr0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d           |                     |j        j	        d            |                     |j        j
        d           d S )Nr  r  T)r  r  r  r  r*   s      r.   $test_element_frame_height_responsivez4TestElementPlot.test_element_frame_height_responsivef  s    iii  %%34%HH&u--*D111)40000#666/666/AAAAAr0   c                    t          g d                              dd          }t          j        |          }|                     |j        j        d            |                     |j        j        d            |                     |j        j        d            |                     |j        j	        d            |                     |j        j
        d           d S )Nr  r2   T)r  r  
scale_bothr  r*   s      r.   test_element_aspect_responsivez.TestElementPlot.test_element_aspect_responsiveo  s    iii  %%Q4%@@&u--*D111)40000$777/666/>>>>>r0   c                 (   t          g d                              ddd          }t          j        |          }| j                            dd           |                     |j        j        d            |                     |j        j	        d            |                     |j        j
        d           |                     |j        j        d           |                     |j        j        d	           | j                            dd
           d S )Nr  r2   r  T)r  r  r  rO  $responsive mode could not be enabledr  fixedr  r   r%   r   r&   rQ  r  r(   r'   r  r  r  r  r  r*   s      r.   $test_element_aspect_width_responsivez4TestElementPlot.test_element_aspect_width_responsivex  s    iii  %%Qcd%KK&u--''	3YZZZ*D111)40000#666/555/999''	3jkkkkkr0   c                 (   t          g d                              ddd          }t          j        |          }|                     |j        j        d           |                     |j        j        d           | j        	                    dd           |                     |j        j
        d            |                     |j        j        d            |                     |j        j        d	           | j        	                    dd
           d S )Nr  r2   r  T)r  r  r  r  rO  r  r  r  )r   r%   r   r&   r(   r'   r  r  rQ  r  r  r  r  r*   s      r.   %test_element_aspect_height_responsivez5TestElementPlot.test_element_aspect_height_responsive  s    iii  %%Qst%LL&u--0#666/555''	3YZZZ*D111)4000/999''	3jkkkkkr0   c                    t          g d                              ddd          }t          j        |          }|                     |j        j        d           |                     |j        j        d           | j        	                    dd           |                     |j        j
        d            |                     |j        j        d            |                     |j        j        d           d S )Nr  r  T)r  r  r  rO  r  r  )r   r%   r   r&   r(   r'   r  r  rQ  r  r  r  r  r*   s      r.   $test_element_width_height_responsivez4TestElementPlot.test_element_width_height_responsive  s    iii  %%S%MM&u--*C000)3///''	3YZZZ0$777/666/99999r0   c                    t          g d                              ddd          }t          j        |          }| j                            dd           |                     |j        j        d            |                     |j        j	        d            |                     |j        j
        d           |                     |j        j        d           |                     |j        j        d	           d S )
Nr  r2   r  T)r  r  r  rO  r  r  r  r  r*   s      r.   *test_element_aspect_frame_width_responsivez:TestElementPlot.test_element_aspect_frame_width_responsive  s    iii  %%QCD%QQ&u--''	3YZZZ*D111)40000#666/555/99999r0   c                 r   t          g d                              ddd          }t          j        |          }|                     |j        j        d           |                     |j        j        d           |                     |j        j        d           | j	        
                    dd	           d S )
Nr  r2   r  T)r  r  r  r  r  rO  r  r   r%   r   r&   r(   r'   r  r  r  rQ  r  r*   s      r.   +test_element_aspect_frame_height_responsivez;TestElementPlot.test_element_aspect_frame_height_responsive  s    iii  %%QST%RR&u--0#666/555/999''	3YZZZZZr0   c                 r   t          g d                              ddd          }t          j        |          }|                     |j        j        d           |                     |j        j        d           |                     |j        j        d           | j	        
                    dd           d S )Nr  r  T)r  r  r  r  rO  r  r  r*   s      r.   0test_element_frame_width_frame_height_responsivez@TestElementPlot.test_element_frame_width_frame_height_responsive  s    iii  %%3CTX%YY&u--0#666/555/999''	3YZZZZZr0   c                 :   t          ddg                              dd          }t          j        |          }|                     |j        j        d           |                     |j        j        d           |                     |j        j        d           d S )Nr   r2   r   T)r  r  r  r  )	r   r%   r   r&   r(   r'   r  r  r  r*   s      r.   #test_element_data_aspect_responsivez3TestElementPlot.test_element_data_aspect_responsive  s    q!f""qT"BB&u--0#6660!444/>>>>>r0   c                 H   t          ddg                              ddd          }t          j        |          }|                     |j        j        d           |                     |j        j        d           |                     |j        j        d           |j	        d         }|j	        d	         }|                     |j
        d           |                     |j        d           |                     |j
        d           |                     |j        d           d S )
Nr   r2   r   T)r  r  r  r  r  r}  r  )r   r%   r   r&   r(   r'   r  r  r  r<   r  r  r  s        r.   .test_element_data_aspect_and_aspect_responsivez>TestElementPlot.test_element_data_aspect_and_aspect_responsive  s   q!f""qt"LL&u--0#6660!444/>>>,y),y)***a(((***a(((((r0   c                    t          g d                              ddd          }t          j        |          }|                     |j        j        d           |                     |j        j        d           |                     |j        j        d           | j	        
                    dd           | j	        
                    dd	           d S )
Nr  r2   r  T)r  r  r  r  rO  r  r  r  r*   s      r.   )test_element_data_aspect_width_responsivez9TestElementPlot.test_element_data_aspect_width_responsive  s    &&&'',,#RV,WW&u--0#666/555/999''	3YZZZ''	3jkkkkkr0   c                    t          g d                              ddd          }t          j        |          }|                     |j        j        d           |                     |j        j        d           |                     |j        j        d           | j	        
                    dd           | j	        
                    dd	           d S )
Nr  r2   r  T)r  r  r  r  rO  r  r  r  r*   s      r.   *test_element_data_aspect_height_responsivez:TestElementPlot.test_element_data_aspect_height_responsive  s    &&&'',,3SW,XX&u--0#666/555/999''	3YZZZ''	3jkkkkkr0   c                 r   t          g d                              ddd          }t          j        |          }|                     |j        j        d           |                     |j        j        d           |                     |j        j        d           | j	        
                    dd	           d S )
Nr  r2   r  T)r  r  r  r  r  rO  r  r  r*   s      r.   /test_element_data_aspect_frame_width_responsivez?TestElementPlot.test_element_data_aspect_frame_width_responsive  s    iii  %%!QU%VV&u--0#666/555/999''	3YZZZZZr0   c                 r   t          g d                              ddd          }t          j        |          }|                     |j        j        d           |                     |j        j        d           |                     |j        j        d           | j	        
                    dd	           d S )
Nr  r2   r  T)r  r  r  r  r  rO  r  r  r*   s      r.   0test_element_data_aspect_frame_height_responsivez@TestElementPlot.test_element_data_aspect_frame_height_responsive  s    iii  %%!#RV%WW&u--0#666/555/999''	3YZZZZZr0   c                 p   t          g d                              ddt          d          dddd	          }t          j        |          }|j        d
         }|                     |j        d           |                     |j        j	        d           |                     |j
        ddd           d S )Nr  )r2   r   r   )r   r   r   TTestingg      @r   r   r   r3  )zcolorbar.titlezcolorbar.tickerzcolorbar.major_label_overridescolorbarbackend_optsr  r   r%   r   r   r&   r<   r(   r5   r   r   r   r+   heat_mapr-   r  s       r.   test_element_backend_optsz)TestElementPlot.test_element_backend_opts  s    <<<==BB"+#.X#>#>#>8;2D2D  C 
 
 &x00<
+333.9997ss9K9KLLLLLr0   c                 p   t          g d                              ddt          d          dddd	          }t          j        |          }|j        d
         }|                     |j        d           |                     |j        j	        d           |                     |j
        ddd           d S )Nr  Tr  r  r  r   r3  )z
cbar.titlezcbar.tickerzcbar.major_label_overridesr  r  r  r  s       r.   test_element_backend_opts_aliasz/TestElementPlot.test_element_backend_opts_alias  s    <<<==BB'*:::47C.@.@  C 
 
 &x00<
+333.9997ss9K9KLLLLLr0   c                     t          g d                              dddi          }t          j        |           | j                            dd           d S )Nr  Tr  r  r  rO  z-Custom option 'colorbar' expects at least twor   r%   r   r&   rQ  r  r+   r  s     r.   'test_element_backend_opts_two_accessorsz7TestElementPlot.test_element_backend_opts_two_accessors
  st    <<<==BBY(? C 
 
 	)))''F	
 	
 	
 	
 	
r0   c                     t          g d                              dddi          }t          j        |           | j                            dd           d S )Nr  Tzcb.titler  r  rO  zcb model could not ber  r  s     r.   ,test_element_backend_opts_model_not_resolvedz<TestElementPlot.test_element_backend_opts_model_not_resolved  st    <<<==BBY(? C 
 
 	)))''.	
 	
 	
 	
 	
r0   N)X__name__
__module____qualname__r/   rB   rH   rM   rT   r\   r^   r`   re   ri   rk   rm   rv   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r,  r/  r;  r=  rL  rT  r^  rd  ri  rn  rv  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r0   r.   r    r       s       5 5 5

C 
C 
C
C 
C 
CC C C3 3 33 3 33 3 33 3 33 3 32 2 22 2 23 3 3	6 	6 	6: : :6 6 67 7 77 7 72 2 22 2 2@ @ @
0 0 0
0 0 0
I I I
I I I
E E E
E E E
8 8 87 7 77 7 77 7 7(4 4 4Q Q Q_ _ _N N N
N N N
A A A> > >> > >= = == = =O O O; ; ;(F F FJ J JA A AH H HY Y Y; ; ;. . .8 8 8l l ll l lO O O8 8 88 8 8O O O7 7 7l l ll l l
) 
) 
)5 5 55 5 55 5 5A A AC C CB B BC C CB B B? ? ?	l 	l 	l	l 	l 	l: : :: : :[ [ [[ [ [? ? ?) ) )l l ll l l[ [ [[ [ [M M MM M M
 
 

 
 
 
 
r0   r    c                   V    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd ZdS )TestColorbarPlotc                 *   t          t          j        ddgddgg                                        d          }t	          j        |          }|j        d         }|                     |j        d           |                     |j	        d           d S )	Nr   r   r2   r   T)	symmetriccolor_mapper
r   r   rI  r%   r   r&   r<   r(   lowhighr+   r   r-   cmappers       r.   test_colormapper_symmetricz+TestColorbarPlot.test_colormapper_symmetric  s    BHq!fq!f-..//44t4DD&s++,~.b)))q)))))r0   c                 *   t          t          j        ddgddgg                                        d          }t	          j        |          }|j        d         }|                     |j        d           |                     |j	        d           d S )Nr   r   r2   r   Tlogzr  r  r
  s       r.   $test_colormapper_logz_int_zero_boundz5TestColorbarPlot.test_colormapper_logz_int_zero_bound%  s    BHq!fq!f-..//44$4??&s++,~.a(((q)))))r0   c                 `   t          t          j        ddgddgg                                        d          }t	          j        |          }|j        d         }|                     |j        d           |                     |j	        d           | j
                            d	d
           d S )Nr   r   r2   g      @Tr  r  r   rO  z!Log color mapper lower bound <= 0)r   r   rI  r%   r   r&   r<   r(   r  r	  rQ  r  r
  s       r.   &test_colormapper_logz_float_zero_boundz7TestColorbarPlot.test_colormapper_logz_float_zero_bound,  s    BHq!fq"g.//005545@@&s++,~.a(((q)))''	3VWWWWWr0   c                 l   t          dd          }t          t          j        ddgddgg                                        d|	          }t          j        |          }|j        d
         }|                     t          |j
                  d           |                     |j
        g d           d S )Nviridisbokeh)providerr   r   r2   r   r   )color_levelscmapr  )z#440154z#440255z#440357z#450558z#45065A)r   r   r   rI  r%   r   r&   r<   r(   lenpalette)r+   r  r   r-   r  s        r.   test_colormapper_color_levelsz.TestColorbarPlot.test_colormapper_color_levels4  s    I888BHq!fq!f-..//44!$4OO&s++,~.W_--q111*a*a*abbbbbr0   c                     t          t          j        ddgddgg                                        ddi          }t	          j        |          }|j        d         }|                     |j        d	           d S )
Nr   r   r2   r   NaNtransparentclipping_colorsr  zrgba(0, 0, 0, 0))	r   r   rI  r%   r   r&   r<   r(   	nan_colorr
  s       r.    test_colormapper_transparent_nanz1TestColorbarPlot.test_colormapper_transparent_nan<  sx    BHq!fq!f-..//44e]E[4\\&s++,~.*,>?????r0   c                     t          t          j        ddgddgg                                        d          }t	          j        |          }|j        d         }|                     |t                     d S )Nr   r   r2   r   linearcnormr  )	r   r   rI  r%   r   r&   r<   rQ   r   r
  s       r.   test_colormapper_cnorm_linearz.TestColorbarPlot.test_colormapper_cnorm_linearB  sn    BHq!fq!f-..//4484DD&s++,~.!233333r0   c                     t          t          j        ddgddgg                                        d          }t	          j        |          }|j        d         }|                     |t                     d S )Nr   r   r2   r   logr%  r  )	r   r   rI  r%   r   r&   r<   rQ   r   r
  s       r.   test_colormapper_cnorm_logz+TestColorbarPlot.test_colormapper_cnorm_logH  sm    BHq!fq!f-..//4454AA&s++,~.00000r0   c                     t          t          j        ddgddgg                                        d          }t	          j        |          }|j        d         }|                     |t                     d S )Nr   r   r2   r   eq_histr%  r  )	r   r   rI  r%   r   r&   r<   rQ   r   r
  s       r.   test_colormapper_cnorm_eqhistz.TestColorbarPlot.test_colormapper_cnorm_eqhistN  sn    BHq!fq!f-..//4494EE&s++,~.!233333r0   c                 0   t          t          j        ddgddgg                                        ddd          }t	          j        |          }|j        d	         }|                     |j        d           |                     |j	        d           d S )
Nr   r   r2   r   redr  )minmaxr  r  )
r   r   rI  r%   r   r&   r<   r(   	low_color
high_colorr
  s       r.   test_colormapper_min_max_colorsz0TestColorbarPlot.test_colormapper_min_max_colorsU  s    BHq!fq!f-..//44U[aEbEb4cc&s++,~.*E222+V44444r0   c                 .   t                      }t          t          j        ddgddgg                                        dt          |                    }t          j        |          }|j        d         }| 	                    |j
        |           d S )	Nr   r   r2   r   T)r   )r  colorbar_optsr  )r	   r   r   rI  r%   dictr   r&   r<   r   r   )r+   r   r   r-   r  s        r.   test_custom_colorbar_tickerz,TestColorbarPlot.test_custom_colorbar_ticker\  s    BHq!fq!f-..//44dRV^dReReRe4ff&s++<
+hov.....r0   c                 ,   t          t          j        ddgddgg                                        dd          }t	          j        |          }|j        d         }|                     |j        d           |                     |j	        d	           d S )
Nr   r   r2   r   T)r  r4   r  r9   r:   )
r   r   rI  r%   r   r&   r<   r(   title_text_font_sizer?   )r+   r   r-   r  s       r.   test_colorbar_fontsize_scalingz/TestColorbarPlot.test_colorbar_fontsize_scalingc  s    BHq!fq!f-..//44da4PP&s++<
+6???<fEEEEEr0   c                    t          g d          }t          g dg dg dfddg                              d|          }t          j        |          }|j        d         }|j        d         }|                     |j        d	         g d
           |                     |j        g d
           |                     |j	        g d           d S )N))r   r  )r   r/  )r2   green)r   purple)r   r   r2   r   r   Categoryrp  )color_indexr  r  rB  Category_str__)0123)r  r/  r=  r>  )
r7  r   r%   r   r&   r<   r(   r   r~  r  )r+   explicit_mappingpointsr-   r  rB  s         r.   .test_explicit_categorical_cmap_on_integer_dataz?TestColorbarPlot.test_explicit_categorical_cmap_on_integer_dataj  s     V V VWW,,,lllCCQ[K\]]]bb")9 c 
 
 &v..,~.l5!"235I5I5IJJJ*>*>*>???*L*L*LMMMMMr0   N)r  r  r  r  r  r  r  r"  r'  r*  r-  r4  r8  r;  rH  r   r0   r.   r  r    s        * * ** * *X X Xc c c@ @ @4 4 41 1 14 4 45 5 5/ / /F F F
N 
N 
N 
N 
Nr0   r  c                   b    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd ZdS )TestOverlayPlotc                 (   t          g                               d          t          g                               d          z  }d}t          j        t          |          5  t          j        |           d d d            d S # 1 swxY w Y   d S )Npolar
projectioncustomz0An axis may only be assigned one projection type)match)r   r%   pytestraises
ValueErrorr   r&   )r+   overlaymsgs      r.    test_overlay_projection_clashingz0TestOverlayPlot.test_overlay_projection_clashingy  s    ))..G.44uRyy~~QY~7Z7ZZ@]:S111 	- 	-#G,,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-s   %BBBc                    t          g           t          g                               d          z  }t          j        |          }|                     d |j                                        D             ddg           d S )NrO  rM  c                     g | ]	}|j         
S r   rM  )r   ps     r.   r   zFTestOverlayPlot.test_overlay_projection_propagates.<locals>.<listcomp>  s    GGG1!,GGGr0   )r   r%   r   r&   r(   subplotsr(  r+   rT  r-   s      r.   "test_overlay_projection_propagatesz2TestOverlayPlot.test_overlay_projection_propagates  su    ))eBiinnnAAA&w//GG0D0D0F0FGGG(T\I]^^^^^r0   c                     t          d t          d          D                                           dd          }t          j        |          }|                     |j        j        j        j	        d           d S )Nc                 Z    i | ](}|t          g d                               d          )S )r  z%.1fr   )r   r%   r   s     r.   
<dictcomp>zCTestOverlayPlot.test_overlay_propagates_batched.<locals>.<dictcomp>  sD     
 
 
<=AuYYY$$$77
 
 
r0   r"   z%.3fr   )r   legend_limit)
r   r$   r%   r   r&   r(   r'   r7   r   r   r[  s      r.   test_overlay_propagates_batchedz/TestOverlayPlot.test_overlay_propagates_batched  s     
 
AFr
 
 
  46422 	 &w//)3:FCCCCCr0   c                 R   ddd}t          dg                              |dd          t          dg          z  }t          j        |          }|                     |j        j        d	         j        d           |                     |j        j        d	         j	        d           d S )
Nr  r2   )r  r  )r"   r"   T   )r  r  size)r"   r"   r   r   )
r   r%   r   r   r&   r(   r'   r  r  r  )r+   r  rT  r-   s       r.   test_overlay_gridstyle_appliesz.TestOverlayPlot.test_overlay_gridstyle_applies  s    )/AFF
G9%%**Z4VX*YY]O,,-&w//)!,<fEEE)!,<a@@@@@r0   c                 $   t          d t          d          D                                           d          }t          j        |          }|j                                        D ]'}|                     |j        d         j	                   (d S )Nc                     i | ]A}|t          t          j                            d                                                     BS )r"   )r   r   randomrandncumsumr   s     r.   r_  z?TestOverlayPlot.test_ndoverlay_legend_muted.<locals>.<dictcomp>  s<    VVVQbioob&9&9&@&@&B&B C CVVVr0   r   Tlegend_mutedr   )
r   r$   r%   r   r&   rZ  r(  rQ   r<   mutedr+   rT  r-   sps       r.   test_ndoverlay_legend_mutedz+TestOverlayPlot.test_ndoverlay_legend_muted  s    VVUSTXXVVVWW\\jn\oo&w//-&&(( 	@ 	@BOOBJ'78>????	@ 	@r0   c                    t          t          j                            d                                          d          t          t          j                            d                                          d          z                      d          }t          j        |          }|j        	                                D ]'}| 
                    |j        d         j                   (d S )Nr"   r   r|   r3  Trk  r   )r   r   rh  ri  rj  r%   r   r&   rZ  r(  rQ   r<   rm  rn  s       r.   test_overlay_legend_mutedz)TestOverlayPlot.test_overlay_legend_muted  s    ,,3355SAAA,,3355SAAABCG4UY4CZCZ 	&w//-&&(( 	@ 	@BOOBJ'78>????	@ 	@r0   c                    t          t          j                            d                                          d          t          t          j                            d                                          d          z                      ddd          }t          j        |          }|j        j	        }| 
                    |j        d           | 
                    |j        d           d S )	Nr"   r   r|   r3  r  r/  )background_fill_alphabackground_fill_color)legend_opts)r   r   rh  ri  rj  r%   r   r&   r'   legendr(   rt  ru  )r+   rT  r-   rw  s       r.   test_overlay_legend_optsz(TestOverlayPlot.test_overlay_legend_opts  s    ")//"%%,,..c:::")//"%%,,..c:::;
$SSXYY$
Z
Z 	 &w//"5s;;;5u=====r0   c                    t          g d          }t          g d          }||z                      dg          }t          j        |          }|j        j        }|                     |j        t          j
                   d S rV  )r   r   r%   r   r&   r'   rZ  r   r[  r   r\  r+   r,   r   rT  r-   rZ  s         r.   r^  z&TestOverlayPlot.test_active_tools_drag  s|    iii  )))$$U?((zl(CC&w//*$g153DEEEEEr0   c                    t          g d          }t          g d          }||z                      dg          }t          j        |          }|j        j        }|                     |j        t          j
                   d S r`  )r   r   r%   r   r&   r'   rZ  r   rb  r   rc  rz  s         r.   rd  z(TestOverlayPlot.test_active_tools_scroll  s|    iii  )))$$U?((|n(EE&w//*$g3U5HIIIIIr0   c                 2   t          g d          }t          g d                              dg          }||z                      dg          }t          j        |          }|j        j        }|                     |j        t          j
                   d S )Nr  rf  rs  rX  )r   r   r%   r   r&   r'   rZ  r   rg  r   rh  rz  s         r.   ri  z%TestOverlayPlot.test_active_tools_tap  s    iii  )))$$)))88U?((ug(>>&w//*$g0%-@@@@@r0   c                 r   t          g d          }t          g d                              dg          }t          |           ||z  }t	          j        |          }|j        j        }|                     |j	        t          j                   |                     |j        t          j                   d S rk  )r   r   r%   r   r   r&   r'   rZ  r   rg  r   rm  r[  rz  s         r.   rn  z-TestOverlayPlot.test_active_tools_draw_stream  s    iii  )))$$))~)FF!!!!U?&w//*$g0%2EFFFg153FGGGGGr0   c                     t          ddg          j                            g d          }t          dg          }t	          j        ||z            }|j        d         }|                     |j        g d           d S )Nrx  rz  r{  r|  r   r2   r}  )	r   r'  r(  r   r   r&   r<   r(   r~  r+   r,   r   r-   r}  s        r.   )test_categorical_overlay_dimension_valuesz9TestOverlayPlot.test_categorical_overlay_dimension_values  s}    x*++188???8KK8*%%&uW}55,y)///:::::r0   c                     t          ddg          }t          dg          }t          j        ||z  j                            ddg                    }|j        d         }|                     |j        ddg           d S )Nrx  rz  r  r   ry  r|  r}  )	r   r   r   r&   r'  r(  r<   r(   r~  r  s        r.   5test_categorical_overlay_dimension_values_skip_factorzETestOverlayPlot.test_categorical_overlay_dimension_values_skip_factor  s}    x*++8*%%&g'<'C'CsCj'C'Q'QRR,y)3*55555r0   c                     t           j                            dd          }d|d<   d|d<   t          |                              d          }t          j        |          }|j        d         d	         d
         \  }}|dk    sJ |dk     sJ d S )Nr"   i)r   r   d   )r  T)clim_percentile)r   zrobustr   r   )r   rh  randr   r%   r   r&   ranges)r+   arrimr-   r  r	  s         r.   test_clim_percentilez$TestOverlayPlot.test_clim_percentile  s    innR##D	F3ZZ__T_22&r**K
+C0:	TQwwwwaxxxxxxr0   N)r  r  r  rV  r\  ra  re  rp  rr  rx  r^  rd  ri  rn  r  r  r  r   r0   r.   rJ  rJ  w  s       - - -_ _ _
D D DA A A@ @ @@ @ @> > >F F FJ J JA A AH H H; ; ;6 6 6	 	 	 	 	r0   rJ  )/r   r   unittestr   numpyr   panelr   rQ  bokeh.documentr   bokeh.modelsr   r   r   r   r	   r
   r   r   holoviews.corer   r   r   holoviews.core.utilr   holoviews.elementr   r   r   r   r   holoviews.plotting.utilr   holoviews.streamsr   r   holoviews.utilr   utilsr   	test_plotr   r   r    r  rJ  r   r0   r.   <module>r     s.                      # # # # # #	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 : 9 9 9 9 9 9 9 9 9 ) ) ) ) ) ) D D D D D D D D D D D D D D 0 0 0 0 0 0 / / / / / / / / ! ! ! ! ! ! . . . . . . 4 4 4 4 4 4 4 4|
 |
 |
 |
 |
/ |
 |
 |
|XN XN XN XN XN0- XN XN XNvl l l l lm l l l l lr0   