U
    /ef                     @  sZ  d Z ddlmZ ddlZeeZddlmZ ddl	m
Z
 ddl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 ddlmZmZ ddlmZmZ ddlmZmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z)m*Z*m+Z+m,Z, ddl-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3 erLddl4m5Z5 ddl6m7Z7 ddl8m9Z9 dZ:e#dddd Z;e#dddd d!Z<G d"d# d#e!Z=G d$d% d%e=Z>G d&d' d'e=Z?G d(d) d)e?Z@G d*d+ d+e=ZAG d,d- d-e=ZBG d.d/ d/e=ZCG d0d1 d1e=ZDG d2d3 d3e=ZEG d4d5 d5e=ZFG d6d7 d7e=ZGG d8d9 d9e=ZHG d:d; d;e=ZIG d<d= d=e=ZJG d>d? d?e=ZKG d@dA dAe?ZLG dBdC dCeLZMG dDdE dEeMZNG dFdG dGeMZOG dHdI dIeOZPG dJdK dKe?ZQG dLdM dMe=ZRG dNdO dOe
dPdQZSG dRdS dSe
dPdQZTG dTdU dUe
dPdQZUdddVdWdOdXdYdZVdedZdWdSd[d\dZWdfd]dWdUd^d_dZXd`da ZYdbdc ZZdS )gz/ Provide the DataSpec properties and helpers.

    )annotationsN)TYPE_CHECKING)	TypedDict   )colors)
deprecated)convert_datetime_typeconvert_timedelta_type)	nice_join   )enums   )Color)DictList)Datetime	TimeDelta)DataSpecPropertyDescriptorUnitsSpecPropertyDescriptor)Either)Enum)Instance)Nullable)FloatIntNullString)	Undefined)DashPatternFontSizeHatchPatternType
MarkerType)Unknown)
Expression)	Transform)	AlphaSpec	AngleSpec	ColorSpecDashPatternSpecDataSpecDistanceSpecexprfieldFontSizeSpecFontStyleSpecHatchPatternSpecIntSpecLineCapSpecLineJoinSpec
MarkerSpec
NumberSpecSizeSpec
StringSpecTextAlignSpecTextBaselineSpecvaluer+   r,   r9   	transformunitsc                      s8   e Zd ZdZddd fddZdd Zd	d
 Z  ZS )r)   a   Base class for properties that accept either a fixed value, or a
    string name that references a column in a
    :class:`~bokeh.models.sources.ColumnDataSource`.

    Many Bokeh models have properties that a user might want to set either
    to a single fixed value, or to have the property take values from some
    column in a data source. As a concrete example consider a glyph with
    an ``x`` property for location. We might want to set all the glyphs
    that get drawn to have the same location, say ``x=10``. It would be
    convenient to  just be able to write:

    .. code-block:: python

        glyph.x = 10

    Alternatively, maybe the each glyph that gets drawn should have a
    different location, according to the "pressure" column of a data
    source. In this case we would like to be able to write:

    .. code-block:: python

        glyph.x = "pressure"

    Bokeh ``DataSpec`` properties (and subclasses) afford this ease of
    and consistency of expression. Ultimately, all ``DataSpec`` properties
    resolve to dictionary values, with either a ``"value"`` key, or a
    ``"field"`` key, depending on how it is set.

    For instance:

    .. code-block:: python

        glyph.x = 10          # => { 'value': 10 }

        glyph.x = "pressure"  # => { 'field': 'pressure' }

    When these underlying dictionary dictionary values are received in
    the browser, BokehJS knows how to interpret them and take the correct,
    expected action (i.e., draw the glyph at ``x=10``, or draw the glyph
    with ``x`` coordinates from the "pressure" column). In this way, both
    use-cases may be expressed easily in python, without having to handle
    anything differently, from the user perspective.

    It is worth noting that ``DataSpec`` properties can also be set directly
    with properly formed dictionary values:

    .. code-block:: python

        glyph.x = { 'value': 10 }         # same as glyph.x = 10

        glyph.x = { 'field': 'pressure' } # same as glyph.x = "pressure"

    Setting the property directly as a dict can be useful in certain
    situations. For instance some ``DataSpec`` subclasses also add a
    ``"units"`` key to the dictionary. This key is often set automatically,
    but the dictionary format provides a direct mechanism to override as
    necessary. Additionally, ``DataSpec`` can have a ``"transform"`` key,
    that specifies a client-side transform that should be applied to any
    fixed or field values before they are uses. As an example, you might want
    to apply a ``Jitter`` transform to the ``x`` values:

    .. code-block:: python

        glyph.x = { 'value': 10, 'transform': Jitter(width=0.4) }

    Note that ``DataSpec`` is not normally useful on its own. Typically,
    a model will define properties using one of the subclasses such
    as :class:`~bokeh.core.properties.NumberSpec` or
    :class:`~bokeh.core.properties.ColorSpec`. For example, a Bokeh
    model with ``x``, ``y`` and ``color`` properties that can handle
    fixed values or columns automatically might look like:

    .. code-block:: python

        class SomeModel(Model):

            x = NumberSpec(default=0, help="docs for x")

            y = NumberSpec(default=0, help="docs for y")

            color = ColorSpec(help="docs for color") # defaults to None

    NNonereturnc              	     sR   t  jtt|tttdtd||||d | || _| tddd  d S )Nz!bokeh.models.transforms.Transformz#bokeh.models.expressions.Expressiondefaulthelpc                 S  s   t | S Nr+   )obj rE   @/tmp/pip-unpacked-wheel-f5fndrjf/bokeh/core/property/dataspec.py<lambda>       z#DataSpec.__init__.<locals>.<lambda>)	super__init__r   r   r   r   _validate_type_param_typeaccepts)selfkey_typeZ
value_typer@   rA   	__class__rE   rF   rJ      s"    zDataSpec.__init__c                 C  s   t || gS )a   Return a list of ``DataSpecPropertyDescriptor`` instances to
        install on a class, in order to delegate attribute access to this
        property.

        Args:
            base_name (str) : the name of the property these descriptors are for

        Returns:
            list[DataSpecPropertyDescriptor]

        The descriptors returned are collected by the ``MetaHasProps``
        metaclass and added to ``HasProps`` subclasses during class creation.
        )r   )rN   	base_namerE   rE   rF   make_descriptors   s    zDataSpec.make_descriptorsc                 C  sL   z| j |d t|dW S  tk
r.   Y nX t|trDt|dS t|S )NFr9   r,   )rL   validatedict
ValueError
isinstancestrrN   rD   namevalrE   rE   rF   to_serializable   s    

zDataSpec.to_serializable)N)__name__
__module____qualname____doc__rJ   rS   r^   __classcell__rE   rE   rP   rF   r)   f   s   Sr)   c                      s(   e Zd Zdefdd fddZ  ZS )r0   Nr<   r=   c                   s   t  j|t||d d S Nr?   )rI   rJ   r   rN   r@   rA   rO   rP   rE   rF   rJ      s    zIntSpec.__init__r_   r`   ra   _ExprFieldValueTransformrJ   rc   rE   rE   rP   rF   r0      s   r0   c                      s2   e Zd ZdZededdfdd fddZ  ZS )r4   au   A |DataSpec| property that accepts numeric and datetime fixed values.

    By default, date and datetime values are immediately converted to
    milliseconds since epoch. It is possible to disable processing of datetime
    values by passing ``accept_datetime=False``.

    By default, timedelta values are immediately converted to absolute
    milliseconds.  It is possible to disable processing of timedelta
    values by passing ``accept_timedelta=False``

    Timedelta values are interpreted as absolute milliseconds.

    .. code-block:: python

        m.location = 10.3  # value

        m.location = "foo" # field

    NTr<   r=   c                   s8   t  j|t||d |r$| tt |r4| tt d S rd   )rI   rJ   r   rM   r   r	   r   r   )rN   r@   rA   rO   accept_datetimeaccept_timedeltarP   rE   rF   rJ     s
    zNumberSpec.__init__)r_   r`   ra   rb   r   rg   rJ   rc   rE   rE   rP   rF   r4      s   r4   c                      s(   e Zd ZdZddd fddZ  ZS )	r%   zK    Acceptable values are numbers in 0..1 range (transparent..opaque).
          ?Nr<   r=   c                   s.   |pd d| j  }t j||tddd d S )N 
F)r@   rA   rO   rh   ri   )_default_helprI   rJ   rg   )rN   r@   rA   rP   rE   rF   rJ     s    zAlphaSpec.__init__)rj   N)r_   r`   ra   rm   rJ   rc   rE   rE   rP   rF   r%     s   r%   c                      s*   e Zd Zddefdd fddZ  ZS )NullStringSpecNr<   r=   c                   s    t  j|ttt||d d S rd   )rI   rJ   r   r   r   re   rP   rE   rF   rJ     s    zNullStringSpec.__init__rf   rE   rE   rP   rF   rn     s   rn   c                      s8   e Zd ZdZdefdd fddZ fddZ  ZS )	r6   a   A |DataSpec| property that accepts string fixed values.

    Because acceptable fixed values and field names are both strings, it can
    be necessary explicitly to disambiguate these possibilities. By default,
    string values are interpreted as fields, but the |value| function can be
    used to specify that a string should interpreted as a value:

    .. code-block:: python

        m.title = value("foo") # value

        m.title = "foo"        # field

    Nr<   r=   c                   s   t  j|tt||d d S rd   )rI   rJ   r   r   re   rP   rE   rF   rJ   (  s    zStringSpec.__init__c                   s<   t |tr,t|dkrtdt|d d}t |||S )Nr   z5StringSpec convenience list values must have length 1r   rT   )rY   listlen	TypeErrorrW   rI   prepare_valuerN   clsr\   r9   rP   rE   rF   rr   +  s
    
zStringSpec.prepare_value)r_   r`   ra   rb   rg   rJ   rr   rc   rE   rE   rP   rF   r6     s   r6   c                      s:   e Zd ZdZdefdd fddZd
 fdd		Z  ZS )r-   a   A |DataSpec| property that accepts font-size fixed values.

    The ``FontSizeSpec`` property attempts to first interpret string values as
    font sizes (i.e. valid CSS length values). Otherwise string values are
    interpreted as field names. For example:

    .. code-block:: python

        m.font_size = "13px"  # value

        m.font_size = "1.5em" # value

        m.font_size = "foo"   # field

    A full list of all valid CSS length units can be found here:

    https://drafts.csswg.org/css-values/#lengths

    Nr<   r=   c                   s   t  j|t||d d S rd   )rI   rJ   r   re   rP   rE   rF   rJ   G  s    zFontSizeSpec.__init__Tc                   sZ   t  || t|trVt|dks<|d  rVtj|sV|sDdn|d}t	|d S )Nr   rk   z is not a valid font size value)
rI   rV   rY   rZ   rp   isdigitr   Z_font_size_rematchrX   )rN   r9   ZdetailmsgrP   rE   rF   rV   J  s
    
$zFontSizeSpec.validate)T)r_   r`   ra   rb   rg   rJ   rV   rc   rE   rE   rP   rF   r-   2  s   r-   c                      s(   e Zd Zdefdd fddZ  ZS )r.   Nr<   r=   c                   s   t  j|ttj||d d S rd   )rI   rJ   r   r   Z	FontStylere   rP   rE   rF   rJ   U  s    zFontStyleSpec.__init__rf   rE   rE   rP   rF   r.   T  s   r.   c                      s(   e Zd Zdefdd fddZ  ZS )r7   Nr<   r=   c                   s   t  j|ttj||d d S rd   )rI   rJ   r   r   Z	TextAlignre   rP   rE   rF   rJ   Y  s    zTextAlignSpec.__init__rf   rE   rE   rP   rF   r7   X  s   r7   c                      s(   e Zd Zdefdd fddZ  ZS )r8   Nr<   r=   c                   s   t  j|ttj||d d S rd   )rI   rJ   r   r   ZTextBaselinere   rP   rE   rF   rJ   ]  s    zTextBaselineSpec.__init__rf   rE   rE   rP   rF   r8   \  s   r8   c                      s(   e Zd Zdefdd fddZ  ZS )r2   Nr<   r=   c                   s   t  j|ttj||d d S rd   )rI   rJ   r   r   ZLineJoinre   rP   rE   rF   rJ   a  s    zLineJoinSpec.__init__rf   rE   rE   rP   rF   r2   `  s   r2   c                      s(   e Zd Zdefdd fddZ  ZS )r1   Nr<   r=   c                   s   t  j|ttj||d d S rd   )rI   rJ   r   r   ZLineCapre   rP   rE   rF   rJ   e  s    zLineCapSpec.__init__rf   rE   rE   rP   rF   r1   d  s   r1   c                      s(   e Zd Zdefdd fddZ  ZS )r(   Nr<   r=   c                   s   t  j|t||d d S rd   )rI   rJ   r   re   rP   rE   rF   rJ   i  s    zDashPatternSpec.__init__rf   rE   rE   rP   rF   r(   h  s   r(   c                      s,   e Zd ZdZdefdd fddZ  ZS )r/   a   A |DataSpec| property that accepts hatch pattern types as fixed values.

    The ``HatchPatternSpec`` property attempts to first interpret string values
    as hatch pattern types. Otherwise string values are interpreted as field
    names. For example:

    .. code-block:: python

        m.font_size = "."    # value

        m.font_size = "ring" # value

        m.font_size = "foo"  # field

    Nr<   r=   c                   s   t  j|tt||d d S rd   )rI   rJ   r   r    re   rP   rE   rF   rJ   }  s    zHatchPatternSpec.__init__r_   r`   ra   rb   rg   rJ   rc   rE   rE   rP   rF   r/   l  s   r/   c                      s,   e Zd ZdZdefdd fddZ  ZS )r3   a   A |DataSpec| property that accepts marker types as fixed values.

    The ``MarkerSpec`` property attempts to first interpret string values as
    marker types. Otherwise string values are interpreted as field names.
    For example:

    .. code-block:: python

        m.font_size = "circle" # value

        m.font_size = "square" # value

        m.font_size = "foo"    # field

    Nr<   r=   c                   s   t  j|t||d d S rd   )rI   rJ   r!   re   rP   rE   rF   rJ     s    zMarkerSpec.__init__rx   rE   rE   rP   rF   r3     s   r3   c                      sR   e Zd ZdZddd fddZdddd	Zd
d Zdd Z fddZ  Z	S )	UnitsSpecz A |DataSpec| property that accepts numeric fixed values, and also
    provides an associated units property to store units information.

    Nr<   r=   c                   sB   t  j||td t||ddt| dd}| j|dd| _d S )N)r@   rA   rO   Fz3
        Units to use for the associated property: z	
        )r@   Z
serializedrA   T)Zhelp_allowed)rI   rJ   _ExprFieldValueTransformUnitsr   r
   rK   _units_type)rN   r@   
units_enumunits_defaultrA   Z
units_typerP   rE   rF   rJ     s
    
zUnitsSpec.__init__rZ   c                 C  s   | j j}| jj d|dS )Nz(units_default=))r{   _defaultrQ   r_   )rN   r}   rE   rE   rF   __str__  s    zUnitsSpec.__str__c                 C  s   t ||d S )N_units)getattr)rN   rD   r\   rE   rE   rF   	get_units  s    zUnitsSpec.get_unitsc                 C  s*   |d }| j |}|t|| |d g S )a   Return a list of ``PropertyDescriptor`` instances to install on a
        class, in order to delegate attribute access to this property.

        Unlike simpler property types, ``PropertyUnitsSpec`` returns multiple
        descriptors to install. In particular, descriptors for the base
        property as well as the associated units property are returned.

        Args:
            name (str) : the name of the property these descriptors are for

        Returns:
            list[PropertyDescriptor]

        The descriptors returned are collected by the ``MetaHasProps``
        metaclass and added to ``HasProps`` subclasses during class creation.
        r   r   )r{   rS   r   )rN   rR   Z
units_nameZunits_propsrE   rE   rF   rS     s    zUnitsSpec.make_descriptorsc                   sN   t  |||}|d k	rJd|krJ| ||}|| jjkrJtf |d|i}|S )Nr;   )rI   r^   r   r{   r   rW   )rN   rD   r\   r]   dr;   rP   rE   rF   r^     s    zUnitsSpec.to_serializable)N)
r_   r`   ra   rb   rJ   r   r   rS   r^   rc   rE   rE   rP   rF   ry     s   ry   c                   @  s   e Zd ZdS )PropertyUnitsSpecN)r_   r`   ra   rE   rE   rE   rF   r     s   r   c                      s.   e Zd ZdZeddfdd fddZ  ZS )r&   z A |DataSpec| property that accepts numeric fixed values, and also
    provides an associated units property to store angle units.

    Acceptable values for units are ``"deg"``, ``"rad"``, ``"grad"`` and ``"turn"``.

    ZradNr<   r=   c                   s   t  j|tj||d d S N)r@   r|   r}   rA   )rI   rJ   r   Z
AngleUnitsrN   r@   r}   rA   rP   rE   rF   rJ     s    zAngleSpec.__init__)r_   r`   ra   rb   r   rJ   rc   rE   rE   rP   rF   r&     s   r&   c                      s:   e Zd ZdZeddfdd fddZ fdd	Z  ZS )
r*   a)   A |DataSpec| property that accepts numeric fixed values or strings
    that refer to columns in a :class:`~bokeh.models.sources.ColumnDataSource`,
    and also provides an associated units property to store units information.
    Acceptable values for units are ``"screen"`` and ``"data"``.

    dataNr<   r=   c                   s   t  j|tj||d d S r   )rI   rJ   r   ZSpatialUnitsr   rP   rE   rF   rJ     s    zDistanceSpec.__init__c                   s:   z|dk rt dW n tk
r(   Y nX t |||S )Nr   zDistances must be positive!rX   rq   rI   rr   rs   rP   rE   rF   rr     s    zDistanceSpec.prepare_value)r_   r`   ra   rb   r   rJ   rr   rc   rE   rE   rP   rF   r*     s   r*   c                      s0   e Zd Zd	dd fddZ fddZ  ZS )
NullDistanceSpecNr   r<   r=   c                   s2   t  j|||d t| j| _t g| j | _d S )N)r@   r}   rA   )rI   rJ   r   rL   r   Z_type_paramsr   rP   rE   rF   rJ     s    zNullDistanceSpec.__init__c                   sB   z|d k	r|dk rt dW n tk
r0   Y nX t |||S )Nr   z#Distances must be positive or None!r   rs   rP   rE   rF   rr     s    zNullDistanceSpec.prepare_value)Nr   N)r_   r`   ra   rJ   rr   rc   rE   rE   rP   rF   r     s   r   c                      s    e Zd ZdZ fddZ  ZS )r5   z A |DataSpec| property that accepts non-negative numeric fixed values
    for size values or strings that refer to columns in a
    :class:`~bokeh.models.sources.ColumnDataSource`.
    c                   s:   z|dk rt dW n tk
r(   Y nX t |||S )Nr   zScreen sizes must be positiver   rs   rP   rE   rF   rr     s    zSizeSpec.prepare_value)r_   r`   ra   rb   rr   rc   rE   rE   rP   rF   r5     s   r5   c                      s\   e Zd ZdZdZdefdd fddZedd	 Zed
d Z	dd Z
 fddZ  ZS )r'   a   A |DataSpec| property that accepts |Color| fixed values.

    The ``ColorSpec`` property attempts to first interpret string values as
    colors. Otherwise, string values are interpreted as field names. For
    example:

    .. code-block:: python

        m.color = "#a4225f"   # value (hex color string)

        m.color = "firebrick" # value (named CSS color string)

        m.color = "foo"       # field (named "foo")

    This automatic interpretation can be override using the dict format
    directly, or by using the |field| function:

    .. code-block:: python

        m.color = { "field": "firebrick" } # field (named "firebrick")

        m.color = field("firebrick")       # field (named "firebrick")

    a      Acceptable values are:

    - any of the |named CSS colors|, e.g ``'green'``, ``'indigo'``
    - RGB(A) hex strings, e.g., ``'#FF0000'``, ``'#44444444'``
    - CSS4 color strings, e.g., ``'rgba(255, 0, 127, 0.6)'``, ``'rgb(0 127 0 / 1.0)'``
    - a 3-tuple of integers (r, g, b) between 0 and 255
    - a 4-tuple of (r, g, b, a) where r, g, b are integers between 0..255 and a is between 0..1
    - a 32-bit unsiged integers using the 0xRRGGBBAA byte order pattern

    Nr<   r=   c                   s0   |pd d| j  }t j|tt||d d S )Nrk   rl   r?   )rm   rI   rJ   r   r   re   rP   rE   rF   rJ   +  s    zColorSpec.__init__c                 C  s,   t |to*t|dkr"|d dkp*|tjkS )a   Whether the value is a string color literal.

        Checks for a well-formed hexadecimal color value or a named color.

        Args:
            val (str) : the value to check

        Returns:
            True, if the value is a string color literal

           r   #)rY   rZ   rp   r   Z
NamedColorrt   r]   rE   rE   rF   isconst/  s    
 zColorSpec.isconstc                 C  s(   t |to&t|dko&tdd |D S )z Whether the value is the correct shape to be a color tuple

        Checks for a 3 or 4-tuple of numbers

        Args:
            val (str) : the value to check

        Returns:
            True, if the value could be a color tuple

        )r      c                 s  s   | ]}t |ttfV  qd S rB   )rY   floatint).0vrE   rE   rF   	<genexpr>L  s     z1ColorSpec.is_color_tuple_shape.<locals>.<genexpr>)rY   tuplerp   allr   rE   rE   rF   is_color_tuple_shape?  s    zColorSpec.is_color_tuple_shapec                 C  s   |d krt d dS | |r&t |dS t|trDt tj|  dS t|tjrX| S t|trz|drp|S t |dS t |S )NrT   )zrgb(zrgba(rU   )	rW   r   rY   r   r   ZRGBZto_cssrZ   
startswithr[   rE   rE   rF   r^   N  s    






zColorSpec.to_serializablec                   s0   |  |r tdd t|D }t |||S )Nc                 s  s&   | ]\}}|d k rt |n|V  qdS )r   N)r   )r   ir   rE   rE   rF   r   r  s     z*ColorSpec.prepare_value.<locals>.<genexpr>)r   r   	enumeraterI   rr   rs   rP   rE   rF   rr   h  s    	
zColorSpec.prepare_value)r_   r`   ra   rb   rm   rg   rJ   classmethodr   r   r^   rr   rc   rE   rE   rP   rF   r'     s   

r'   c                   @  s   e Zd ZU ded< ded< dS )Exprr#   r+   Transform | Noner:   Nr_   r`   ra   __annotations__rE   rE   rE   rF   r   w  s   
r   F)totalc                   @  s   e Zd ZU ded< ded< dS )FieldrZ   r,   r   r:   Nr   rE   rE   rE   rF   r   {  s   
r   c                   @  s   e Zd ZU ded< ded< dS )Valuer"   r9   r   r:   Nr   rE   rE   rE   rF   r     s   
r   r#   r   )
expressionr:   r>   c                 C  s   |rt | |dS t | dS )a   Convenience function to explicitly return an "expr" specification for
    a Bokeh |DataSpec| property.

    Args:
        expression (Expression) : a computed expression for a
            ``DataSpec`` property.

        transform (Transform, optional) : a transform to apply (default: None)

    Returns:
        dict : ``{ "expr": expression }``

    .. note::
        This function is included for completeness. String values for
        property specifications are by default interpreted as field names.

    )r+   r:   rC   )r   )r   r:   rE   rE   rF   r+     s    rZ   )r\   r:   r>   c                 C  s   |rt | |dS t | dS )a   Convenience function to explicitly return a "field" specification for
    a Bokeh |DataSpec| property.

    Args:
        name (str) : name of a data source field to reference for a
            ``DataSpec`` property.

        transform (Transform, optional) : a transform to apply (default: None)

    Returns:
        dict : ``{ "field": name }``

    .. note::
        This function is included for completeness. String values for
        property specifications are by default interpreted as field names.

    )r,   r:   rU   )r   )r\   r:   rE   rE   rF   r,     s    r"   )r]   r:   r>   c                 C  s   |rt | |dS t | dS )a_   Convenience function to explicitly return a "value" specification for
    a Bokeh |DataSpec| property.

    Args:
        val (any) : a fixed value to specify for a ``DataSpec`` property.

        transform (Transform, optional) : a transform to apply (default: None)

    Returns:
        dict : ``{ "value": name }``

    .. note::
        String values for property specifications are by default interpreted
        as field names. This function is especially useful when you want to
        specify a fixed value with text properties.

    Example:

        .. code-block:: python

            # The following will take text values to render from a data source
            # column "text_column", but use a fixed value "16px" for font size
            p.text("x", "y", text="text_column",
                   text_font_size=value("16px"), source=source)

    )r9   r:   rT   )r   )r]   r:   rE   rE   rF   r9     s    c                  O  s   t ddd t| |S N)r   r   r   zDataDistanceSpec()z
SizeSpec()r   r5   argskwrE   rE   rF   DataDistanceSpec  s    r   c                  O  s   t ddd t| |S r   r   r   rE   rE   rF   ScreenDistanceSpec  s    r   )N)N)N)[rb   
__future__r   logging	getLoggerr_   logtypingr   Ztyping_extensionsr   rk   r   Zutil.deprecationr   Zutil.serializationr   r	   Zutil.stringr
   r   colorr   	containerr   r   datetimer   r   Zdescriptorsr   r   Zeitherr   enumr   instancer   Znullabler   Z	primitiver   r   r   r   Z
singletonsr   visualr   r   r    r!   Z
core.typesr"   Zmodels.expressionsr#   Zmodels.transformsr$   __all__rg   rz   r)   r0   r4   r%   rn   r6   r-   r.   r7   r8   r2   r1   r(   r/   r3   ry   r   r&   r*   r   r5   r'   r   r   r   r+   r,   r9   r   r   rE   rE   rE   rF   <module>   sv   
 
"5
r#