
    -e|$                    N   d Z ddlmZ ddlZ ej        e          ZddlmZm	Z	m
Z
m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mZmZmZmZ ddlmZmZmZmZm Z m!Z! d	d
l"m#Z#m$Z$ dZ%e G d de#                      Z& G d de&          Z' G d de$          Z( G d de&          Z)dS )z

    )annotationsN   )
AngleUnitsCoordinateUnits	TextAlignVerticalAlign)abstract)Angle	AngleSpecCoordinateLikeEnumFloatIncludeNullStringSpec
NumberSpecOverrideRequiredTextLikefield)	FillProps	LinePropsScalarFillPropsScalarLinePropsScalarTextProps	TextProps   )
AnnotationDataAnnotation)LabelLabelSetTitleTextAnnotationc                       e Zd ZdZd fdZ edd          Z eed	          Z	 ee
d
d          Z ed          Z eedd          Z ed          Z xZS )r"   zG Base class for text annotation models such as labels and titles.

    returnNonec                :     t                      j        |i | d S Nsuper__init__selfargskwargs	__class__s      ?lib/python3.11/site-packages/bokeh/models/annotations/labels.pyr*   zTextAnnotation.__init__M   %    $)&)))))     z-
    A text or LaTeX notation to render.
    defaulthelp)
    The {prop} values for the text.
    r6   
background6
    The {prop} values for the text bounding box.
    prefixr6   Nr5   borderr$   r%   )__name__
__module____qualname____doc__r*   r   textr   r   
text_propsr   background_propsr   background_fill_colorr   border_propsborder_line_color__classcell__r/   s   @r0   r"   r"   F   s         
* * * * * * 8B & 	 	 	D  0 	 	 	J w| K 	 	 	 %HT2227?8 C 	 	 	L !...r2   r"   c                       e Zd ZdZd fdZ eed          Z ee	dd	          Z
 eed
          Z ee	dd	          Z edd	          Z eedd	          Z edd	          Z edd	          Z xZS )r   a   Render a single text label as an annotation.

    ``Label`` will render a single text label at given ``x`` and ``y``
    coordinates, which can be in either screen (pixel) space, or data (axis
    range) space.

    The label can also be configured with a screen space offset from ``x`` and
    ``y``, by using the ``x_offset`` and ``y_offset`` properties.

    Additionally, the label can be rotated with the ``angle`` property.

    There are also standard text, fill, and line properties to control the
    appearance of the text, its background, as well as the rectangular bounding
    box border.

    See :ref:`ug_basic_annotations_labels` for information on plotting labels.

    r$   r%   c                :     t                      j        |i | d S r'   r(   r+   s      r0   r*   zLabel.__init__y   r1   r2   zL
    The x-coordinate in screen coordinates to locate the text anchors.
    r8   datazX
    The unit type for the x attribute. Interpreted as |data units| by
    default.
    r4   zL
    The y-coordinate in screen coordinates to locate the text anchors.
    zX
    The unit type for the y attribute. Interpreted as |data units| by
    default.
    r   zH
    The angle to rotate the text, as measured from the horizontal.
    radzA
    Acceptable values for units are ``"rad"`` and ``"deg"``
    z
    Offset value to apply to the x-coordinate.

    This is useful, for instance, if it is desired to "float" text a fixed
    distance in |screen units| from a given data position.
    z
    Offset value to apply to the y-coordinate.

    This is useful, for instance, if it is desired to "float" text a fixed
    distance in |screen units| from a given data position.
    r?   )r@   rA   rB   rC   r*   r   r   xr   r   x_unitsyy_unitsr
   angler   angle_unitsr   x_offsety_offsetrJ   rK   s   @r0   r   r   d   s9        (* * * * * * 	 ' 		 		 		A d?F : 	 	 	G
 	 ' 		 		 		A d?F : 	 	 	G
 E! # 	 	 	E $z5 8 	 	 	K uQ & 	 	 	H uQ & 	 	 	HHHHHr2   r   c                      e Zd ZdZd fdZ e ed          d          Z ee	dd	          Z
 e ed
          d          Z ee	dd          Z e ed          d          Z edd          Z edd          Z edd          Z eed          Z eedd          Z ed          Z eedd          Z ed          Z xZS )r    a.   Render multiple text labels as annotations.

    ``LabelSet`` will render multiple text labels at given ``x`` and ``y``
    coordinates, which can be in either screen (pixel) space, or data (axis
    range) space. In this case (as opposed to the single ``Label`` model),
    ``x`` and ``y`` can also be the name of a column from a
    :class:`~bokeh.models.sources.ColumnDataSource`, in which case the labels
    will be "vectorized" using coordinate values from the specified columns.

    The label can also be configured with a screen space offset from ``x`` and
    ``y``, by using the ``x_offset`` and ``y_offset`` properties. These offsets
    may be vectorized by giving the name of a data source column.

    Additionally, the label can be rotated with the ``angle`` property (which
    may also be a column name.)

    There are also standard text, fill, and line properties to control the
    appearance of the text, its background, as well as the rectangular bounding
    box border.

    The data source is provided by setting the ``source`` property.

    r$   r%   c                :     t                      j        |i | d S r'   r(   r+   s      r0   r*   zLabelSet.__init__   r1   r2   rP   z7
    The x-coordinates to locate the text anchors.
    r4   rN   z]
    The unit type for the ``xs`` attribute. Interpreted as |data units| by
    default.
    rR   z7
    The y-coordinates to locate the text anchors.
    z]
    The unit type for the ``ys`` attribute. Interpreted as |data units| by
    default.
    rD   z$
    The text values to render.
    r   zI
    The angles to rotate the text, as measured from the horizontal.
    z
    Offset values to apply to the x-coordinates.

    This is useful, for instance, if it is desired to "float" text a fixed
    distance in |screen units| from a given data position.
    z
    Offset values to apply to the y-coordinates.

    This is useful, for instance, if it is desired to "float" text a fixed
    distance in |screen units| from a given data position.
    r7   r8   r9   r:   r;   Nr=   r>   r?   )r@   rA   rB   rC   r*   r   r   rP   r   r   rQ   rR   rS   r   rD   r   rT   rV   rW   r   r   rE   r   rF   r   rG   r   rH   rI   rJ   rK   s   @r0   r    r       s        2* * * * * * 	
55:: - 		 		 		A d?F : 	 	 	G
 	
55:: - 		 		 		A d?F : 	 	 	G
 >%%-- 7 	 	 	D Ia ' 	 	 	E z! + 	 	 	H z! + 	 	 	H  * 	 	 	J wy E 	 	 	 %HT22279X = 	 	 	L !...r2   r    c                       e Zd ZdZd fdZ eedd          Z eedd	          Z	 e
d
d          Z e
dd          Z ed          Z ed          Z ed          Z xZS )r!   z Render a single title box as an annotation.

    See :ref:`ug_basic_annotations_titles` for information on plotting titles.

    r$   r%   c                :     t                      j        |i | d S r'   r(   r+   s      r0   r*   zTitle.__init__  r1   r2   bottomz[
    Alignment of the text in its enclosing space, *across* the direction of the text.
    r4   leftzZ
    Alignment of the text in its enclosing space, *along* the direction of the text.
    r   a+  
    Offset the text by a number of pixels (can be positive or negative). Shifts the text in
    different directions based on the location of the title:

        * above: shifts title right
        * right: shifts title down
        * below: shifts title right
        * left: shifts title up

    
   z
    13pxr=   boldg      ?r?   )r@   rA   rB   rC   r*   r   r   vertical_alignr   alignr   offsetstandoffr   text_font_sizetext_font_styletext_line_heightrJ   rK   s   @r0   r!   r!      s         * * * * * * T- A 	 	 	N DF 2 	 	 	E U1 	$ 		 		 		F uR ' 	 	 	H Xf---Nhv...Ox,,,r2   r!   )*rC   
__future__r   logging	getLoggerr@   log
core.enumsr   r   r   r   core.has_propsr	   core.propertiesr
   r   r   r   r   r   r   r   r   r   r   r   core.property_mixinsr   r   r   r   r   r   
annotationr   r   __all__r"   r   r    r!    r2   r0   <module>rs      sS    # " " " " " g!!            ' & & & & &                                           3 2 2 2 2 2 2 2 
/ / / / /Z / / 
/:>	 >	 >	 >	 >	N >	 >	 >	@S/ S/ S/ S/ S/~ S/ S/ S/j%- %- %- %- %-N %- %- %- %- %-r2   