
    ei                     :    d dl mZ d dlmZ d Zd Zd Zd Z	d Z
y)    Nc                     t        j                         \  } }|j                  ddgddgd       |j                  ddgddgd       |j                          t	        j
                  |       }|j                  j                  dk(  sJ t        |j                        dk(  sJ |j                  d   j                  dk(  sJ |j                  d   j                  dk(  sJ y)	zGTest that when matplotlib legend is present, Plotly uses native legend.r      Line 1labelzLine 2T   N)pltsubplotsplotlegendtlsmpl_to_plotlylayout
showlegendlendatanamefigax
plotly_figs      i/var/www/html/glpi_dashboard/venv/lib/python3.12/site-packages/plotly/matplotlylib/tests/test_renderer.py9test_native_legend_enabled_when_matplotlib_legend_presentr      s    llnGCGGQFQF(G+GGQFQF(G+IIK""3'J ''4///z1$$$??1""h...??1""h...    c                  t   t        j                         \  } }|j                  ddgddgdd       |j                          t	        j
                  |       }|j                  j                  dk(  sJ t        |j                  j                        dk(  sJ t        |j                  j                        dk(  sJ y)zFTest that fake legend shapes are not created when using native legend.r   r   zo-zData with markersr   TN)r	   r
   r   r   r   r   r   r   r   shapesannotationsr   s      r   -test_no_fake_legend_shapes_with_native_legendr      s    llnGCGGQFQFD(;G<IIK""3'J ''4///z  ''(A---z  ,,-222r   c                      t        j                         \  } }|j                  ddgddgd       t        j                  |       }t        |j                  d      r|j                  j                  dk7  sJ yy)zETest that legend is not enabled when no matplotlib legend is present.r   r   r   r   r   TN)r	   r
   r   r   r   hasattrr   r   r   s      r   .test_legend_disabled_when_no_matplotlib_legendr!   %   ss    llnGCGGQFQF(G+""3'J
 J%%|4''4/	0/ 5r   c                  2   t        j                         \  } }|j                  ddgddgd       |j                         }|j	                  d       t        j                  |       }t        |j                  d      r|j                  j                  dk7  sJ yy)	zITest that legend is not enabled when no matplotlib legend is not visible.r   r   r   r   Fr   TN)
r	   r
   r   r   set_visibler   r   r    r   r   )r   r   r   r   s       r   7test_legend_disabled_when_matplotlib_legend_not_visibler$   4   s    llnGCGGQFQF(G+YY[F
u""3'J J%%|4''4/	0/ 5r   c                     t        j                         \  } }|j                  g dg ddd       |j                  g dg ddd       |j                  g dg d	d
d       |j                          t	        j
                  |       }|j                  j                  dk(  sJ t        |j                        dk(  sJ |j                  d   j                  dk(  sJ |j                  d   j                  dk(  sJ |j                  d   j                  dk(  sJ |j                  d   j                  dk(  sJ |j                  d   j                  dk(  sJ |j                  d   j                  dk(  sJ y)zATest native legend works with multiple traces of different types.)r   r   r   )r   r   r   -Liner   )r   r   r   oMarkers)      ?r*   r*   zs-zLine+MarkersT   r   r   r   linesmarkerszlines+markersN)r	   r
   r   r   r   r   r   r   r   r   r   moder   s      r   "test_multiple_traces_native_legendr/   D   sE   llnGCGGIy#VG4GGIy#YG7GGINGCIIK""3'J''4///z1$$$??1""f,,,??1""i///??1""n444??1""g---??1""i///??1""o555r   )matplotlib.pyplotpyplotr	   plotly.toolstoolsr   r   r   r!   r$   r/    r   r   <module>r5      s$     /"3 6r   