
    e!                         d dl mZ d dlmZmZmZ d dlmZmZm	Z	 d dl
mZmZ d dlmZ  G d de          Z G d d	e          Z G d
 de          ZdS )    )Overlay)PathAnnotatorPointAnnotatorannotate)PathPointsTable)
EsriStreetTiles)TestBokehPlotc                   &    e Zd Zd Zd Zd Zd ZdS )Test_annotatec                    t          t          g           dg          }t          t          g           dg          }t          j        ||          }|j        j        d         }|j        j        d         }|                     |t                     | 	                    t          |          d           | 	                    |                    d          t          g d                     | 	                    |                    d          t          g d                     |                     |t                     | 	                    t          |          d	           d S )
NLabelannotationsName    r   vdims      )r   r   r   compose
DynamicMapI	AnnotatorassertIsInstancer   assertEquallenget)selflayout1layout2combinedoverlaytabless         ?lib/python3.11/site-packages/holoviews/tests/test_annotators.pytest_compose_annotatorsz%Test_annotate.test_compose_annotators
   s,   6"::G9===488&:::#GW55%'+#%b)gw///Wq)))Q')B)B)BCCCQb)?)?)?@@@fg...Va(((((    c                 n   t          t                      t          g           z  dg          }|j        j        d         }|j        j        d         }|                     |t                     | 	                    t          |          d           |                     |                    d          t                     | 	                    |                    d          t          g d                     |                     |t                     | 	                    t          |          d           d S )Nr   r   r   r   r   r   r   )r   r
   r   r   r   r   r   r   r   r   r    r!   r   )r"   layoutr&   r'   s       r(   test_annotate_overlayz#Test_annotate.test_annotate_overlay   s    *,,3'KKK#%b)!04gw///Wq)))gkk!nne444Q')B)B)BCCCfg...Va(((((r*   c                     t          j                    } |t          g           dg           |                     d|j                   d S Nr   r   )r   instancer   assertIn	annotatedr"   	annotators     r(   test_annotated_propertyz%Test_annotate.test_annotated_property(   sJ    %''		&**7)4444gy233333r*   c                     t          j                    } |t          ddg          dg           |j        j                            dg           |                     |j        t          dgd                     d S )	Nr   r   r   r   r   r   r   )index)r   r    r   )r   r0   r   r4   
_selectionupdater   selectedr3   s     r(   test_selected_propertyz$Test_annotate.test_selected_property-   s    %''		&&&)**	BBBB&--QC-888+VZL-P-P-PQQQQQr*   N)__name__
__module____qualname__r)   r-   r5   r>   r   r*   r(   r   r      sU        ) ) ) ) ) )4 4 4
R R R R Rr*   r   c                   ,    e Zd Zd Zd Zd Zd Zd ZdS )TestPointAnnotatorc                 z    t          t          g           dg          }|                     d|j                   d S r/   )r   r   r1   objectr3   s     r(   test_add_annotationsz'TestPointAnnotator.test_add_annotations6   s9    "6"::G9EEE	gy/00000r*   c                     t          ddg          }|                     |j        j        d           |                     |j        j        d           |                     |j        j        dg           d S )NTest Annotatorr   namer   Test Annotator Tool)r   r   _streamtooltip_tablelabeleditor_namesr3   s     r(   test_add_namez TestPointAnnotator.test_add_name:   sw    "(8wiPPP	*24IJJJ)/1ABBB)03C2DEEEEEr*   c                     t          t          dg          dt          i          }t          dgddgdgd          }|                     |j        |           d S )	Nr7   Intr   )r   r   r   xyr   r   rO   )r   r   intr	   r   rN   r"   r4   expecteds      r(   test_annotation_typez'TestPointAnnotator.test_annotation_type@   s`    "66(#3#3%NNN	)sCjGWXXX)844444r*   c                 R   t          t          g           dg          }t          dg          |_        |                     d|j                   t	          dgddgdgd          }|                     |j        |           |                     |j        j	        |j                   d S )	Nr   r   r7   )r   r   r:   rU   rV   r   rW   )
r   r   rE   r1   r	   r   rN   assertIs_linktargetrY   s      r(   test_replace_objectz&TestPointAnnotator.test_replace_objectE   s    "6"::G9EEE	!6(++	gy/000*Sz'JZ[[[)8444io,i.>?????r*   c                     t          t          dg          dg          }|j                            dgdgdgd           |                     |j        t          d	gdg
                     d S )Nr7   r   r   r   r   A)rU   rV   r   )data)r   r   rb   r   )r   r   rL   eventr   rE   r3   s     r(   test_stream_updatez%TestPointAnnotator.test_stream_updateM   sz    "66(#3#3'KKK	A3aSC5%I%IJJJ)6;-y+Q+Q+QRRRRRr*   N)r?   r@   rA   rF   rR   r[   r`   re   r   r*   r(   rC   rC   4   sj        1 1 1F F F5 5 5
@ @ @S S S S Sr*   rC   c                   &    e Zd Zd Zd Zd Zd ZdS )TestPathAnnotatorc                 z    t          t          g           dg          }|                     d|j                   d S r/   r   r   r1   rE   r3   s     r(   rF   z&TestPathAnnotator.test_add_annotationsV   s9    !$r((	BBB	gy/00000r*   c                 n   t          ddg          }|                     |j        j        d           |                     |j        j        d           |                     |j        j        d           |                     |j        j        d           |                     |j        j	        ddg           d S )NrH   r   rI   rK   zTest Annotator Edit ToolzTest Annotator Vertices)
r   r   rL   rM   _vertex_streamrN   rO   _vertex_tablerP   rQ   r3   s     r(   rR   zTestPathAnnotator.test_add_nameZ   s    !'7gYOOO	*24IJJJ19;UVVV)/1ABBB068QRRR)03CE^2_`````r*   c                 z    t          t          g           dg          }|                     d|j                   d S )Nr   )vertex_annotationsri   r3   s     r(   test_add_vertex_annotationsz-TestPathAnnotator.test_add_vertex_annotationsb   s9    !$r((yIII	gy/00000r*   c                    t          t          g           dgdg          }t          g d          |_        |                     d|j                   t	          dgdgd          }|                     |j        |           t	          g dd	gdd
          }|                     |j        |           |                     |j	        j
        |j                   |                     |j        j
        |j                   d S )Nr   Value)r   rn   )r7   r8   )r   r   r:   r   )kdimsrO   rU   rV   zPathAnnotator Vertices)rO   )r   r   rE   r1   r	   r   rN   rl   r]   r^   r_   _vertex_linkrY   s      r(   r`   z%TestPathAnnotator.test_replace_objectf   s    !$r((	W^V_```	 8 8 899	gy/0002yHHH)8444c3Z8PQQQ0(;;;io,i.>???i,3Y5LMMMMMr*   N)r?   r@   rA   rF   rR   ro   r`   r   r*   r(   rg   rg   T   sX        1 1 1a a a1 1 1	N 	N 	N 	N 	Nr*   rg   N)	holoviewsr   holoviews.annotatorsr   r   r   holoviews.elementr   r   r	   holoviews.element.tilesr
   r   (holoviews.tests.plotting.bokeh.test_plotr   r   rC   rg   r   r*   r(   <module>ry      s!         H H H H H H H H H H 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 5 5 5 B B B B B B)R )R )R )R )RM )R )R )RXS S S S S S S S@N N N N N N N N N Nr*   