
    .i                         d dl Z d dlZ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 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y)    N)Version   )Exporter)FakeRendererFullFakeRendererc                 `     |       }t        |      }|j                  |        |j                  S N)r   runoutput)figRendererrendererexporters       m/opt/house_gps_flutter/.venv/lib/python3.12/site-packages/plotly/matplotlylib/mplexporter/tests/test_basic.pyfake_renderer_outputr      s)    zH!HLL??    c                     t        | j                         j                         |j                         j                               D ]  \  }}||k(  rJ  y r	   )zipstripsplit)text1text2line1line2s       r   _assert_output_equalr      sF    EKKM//15;;=3F3F3HI u~~r   c                      t        j                         \  } }|j                  t        d      d       t	        t        | t              d       t	        t        | t              d       y )N   z-kz
                         opening figure
                         opening axes
                         draw path with 20 vertices
                         closing axes
                         closing figure
                         z
                         opening figure
                         opening axes
                         draw line with 20 points
                         closing axes
                         closing figure
                         pltsubplotsplotranger   r   r   r   r   axs     r   
test_linesr%      sT    llnGCGGE"ItS,/		 S"23		r   c                      t        j                         \  } }|j                  t        d      d       t	        t        | t              d       t	        t        | t              d       y )Nr   oka  
                         opening figure
                         opening axes
                         draw path with 25 vertices
                         draw path with 25 vertices
                         closing axes
                         closing figure
                         z
                         opening figure
                         opening axes
                         draw 2 markers
                         closing axes
                         closing figure
                         r   r#   s     r   test_markersr(   2   sT    llnGCGGE!HdS,/	
 S"23		r   c                      t        j                         \  } }|j                  t        d      t        d             t	        t        | t              d       t	        t        | t              d       y )N   aR  
                         opening figure
                         opening axes
                         draw path with 25 vertices
                         draw path with 25 vertices
                         draw path with 25 vertices
                         closing axes
                         closing figure
                         z
                         opening figure
                         opening axes
                         draw path collection with 3 offsets
                         closing axes
                         closing figure
                         )r   r    scatterr"   r   r   r   r   r#   s     r   test_path_collectionr,   N   sX    llnGCJJuQxq"S,/	 S"23		r   c                      t        j                         \  } }|j                  d       |j                  d       |j	                  d       |j                  ddd       t        t        | t              d       y )Nz
my x labelz
my y labelzmy titleg      ?zmy texta  
                         opening figure
                         opening axes
                         draw text 'my text' None
                         draw text 'my x label' xlabel
                         draw text 'my y label' ylabel
                         draw text 'my title' title
                         closing axes
                         closing figure
                         )	r   r    
set_xlabel
set_ylabel	set_titletextr   r   r   r#   s     r   	test_textr2   k   s\    llnGCMM,MM,LLGGCi S,/		r   c                      t        j                         \  } }|j                  t        j                  dd             |j                  t        j                  ddd             t        t        | t              d       y )Nr   r      r     
                         opening figure
                         opening axes
                         draw path with 25 vertices
                         draw path with 4 vertices
                         closing axes
                         closing figure
                         )r   r    	add_patchCircle	Rectangler   r   r   r#   s     r   	test_pathr:      sX    llnGCLLFA&'LLvq!,-S,/	
r   c                     t        j                         } | j                  d      }|j                  t        j                  dd             |j                  t        j
                  ddd             t        t        | t              d       y)zLif the fig is not associated with a canvas, FakeRenderer shall
    not fail.o   r4   r5   r   r6   N)	r   Figureadd_subplotr7   r8   r9   r   r   r   r#   s     r   test_Figurer?      sd     **,C		BLLFA&'LLvq!,-S,/	
r   c                      t        j                  d      \  } }|d   j                  t        d             |d   j                  t        d             t	        t        | t              d       y )Nr   r      r5   
   ai  
                         opening figure
                         opening axes
                         draw path with 4 vertices
                         closing axes
                         opening axes
                         draw path with 10 vertices
                         closing axes
                         closing figure
                         )r   r    r!   r"   r   r   r   r#   s     r   test_multiaxesrC      sR    ll1oGCqEJJuQxqEJJuRyS,/		r   c                     t        t        j                        t        d      k(  rd} nt        j                  d       t
        j                  j                  d       t        j                  d      \  }}|j                  t
        j                  j                  d      t        j                  j                  d	       t        t        |t              d
  d       y )Nz3.4.1i  zTest fails for older matplotlibr   )r   r   )figsize)rB   rB   nearest)cmapinterpolationz{
                         opening figure
                         opening axes
                         draw image of size zi 
                         closing axes
                         closing figure
                         )r   
matplotlib__version__pytestskipnprandomseedr   r    imshowcmjetr   r   r   )
image_sizer   r$   s      r   
test_imagerT      s     z%%&''*::
56IINN1ll6*GCIIbiix(svvzzISS,/- .8L 9		r   c                      t        j                         \  } }|j                  g dd       |j                         j	                  d       t        t        | t              d       y )Nr5   r   r*   labelrW   Fa9  
                         opening figure
                         opening axes
                         draw path with 3 vertices
                         opening legend
                         closing legend
                         closing axes
                         closing figure
                         )r   r    r!   legendset_visibler   r   r   r#   s     r   test_legendr[      sL    llnGCGGIWG%IIKE"S,/	r   c                      t        j                         \  } }|j                  g dd       |j                  g ddd       |j                         j	                  d       t        t        | t              d       y )	NrV   rW   rX   )r   r   r   odotsTaK  
                         opening figure
                         opening axes
                         draw line with 3 points
                         draw 3 markers
                         opening legend
                         draw line with 2 points
                         draw text 'label' None
                         draw 1 markers
                         draw text 'dots' None
                         draw path with 13 vertices
                         closing legend
                         closing axes
                         closing figure
                         )r   r    r!   rY   rZ   r   r   r   r#   s     r   test_legend_dotsr_      sa    llnGCGGIWG%GGIs&G)IIKD! S"23	r   c                  T    t        j                         \  } }|j                  d       y )Nr   )r   r    axvliner#   s     r   test_blendedrb      s    llnGCJJqMr   )rI   numpyrM   rK   packaging.versionr   r   r   	renderersr   r   matplotlib.pyplotpyplotr   r   r   r%   r(   r,   r2   r:   r?   rC   rT   r[   r_   rb    r   r   <module>ri      s[       %  6 
68:,$*(,$6r   