
    hjeg-                       d Z ddlmZ ddlZ ej        e          Zd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 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 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 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% 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* 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/ dd%l$m0Z0 dd&l$m1Z1 dd'l$m2Z2 dd(l$m3Z3 dd)l$m4Z4 dd*l$m5Z5 dd+l$m6Z6 dd,l$m7Z7 dd-l$m8Z8 dd.l$m9Z9 dd/l:m;Z; dd0l:m<Z< dd1l:m=Z= dd2l:m>Z> dd3l?m@Z@ dd4lAmBZB dd5lCmDZD dd6lEmFZF dd7lEmGZG dd8lHmIZI dd9lJmKZK dd:lJmLZL dd;lJmMZM dd<lNmOZO dd=lPmQZQ dd>lRmSZS dd?lRmTZT dd@lUmVZV ddAlUmWZW ddBlUmXZX ddClUmYZY ddDlUmZZZ ddElUm[Z[ ddFlUm\Z\ ddGlUm]Z] ddHlUm^Z^ ddIl_m`Z` ddJlambZb ddKlamcZc ddLldmeZe ddMldmfZf ddNldmgZg ddOldmhZh ddPldmiZi ddQldmjZj ddRldmkZk ddSllmmZm ddTlnmoZo ddUlpmqZq ddVlrmsZs ddWlrmtZt ddXlumvZv ddYlwmxZx ddZlymzZz dd[lym{Z{ dd\lym|Z| dd]l}m~Z~ dd^l}mZ dd_l}mZ dd`l}mZ ddal}mZ ddbl}mZ ddclmZ dddlmZ dS )ea   Provide property types for Bokeh models

Properties are objects that can be assigned as class attributes on Bokeh
models, to provide automatic serialization, validation, and documentation.

This documentation is broken down into the following sections:

.. contents::
    :local:

Overview
--------

There are many property types defined in the module, for example ``Int`` to
represent integral values, ``Seq`` to represent sequences (e.g. lists or
tuples, etc.). Properties can also be combined: ``Seq(Float)`` represents
a sequence of floating point values.

For example, the following defines a model that has integer, string, and
list[float] properties:

.. code-block:: python

    class SomeModel(Model):
        foo = Int
        bar = String(default="something")
        baz = List(Float, help="docs for baz prop")

As seen, properties can be declared as just the property type, e.g.
``foo = Int``, in which case the properties are automatically instantiated
on new Model objects. Or the property can be instantiated on the class,
and configured with default values and help strings.

The properties of this class can be initialized by specifying keyword
arguments to the initializer:

.. code-block:: python

    m = SomeModel(foo=10, bar="a str", baz=[1,2,3,4])

But also by setting the attributes on an instance:

.. code-block:: python

    m.foo = 20

Attempts to set a property to a value of the wrong type will
result in a ``ValueError`` exception:

.. code-block:: python

    >>> m.foo = 2.3
    Traceback (most recent call last):

      << traceback omitted >>

    ValueError: expected a value of type Integral, got 2.3 of type float

Models with properties know how to serialize themselves, to be understood
by BokehJS. Additionally, any help strings provided on properties can be
easily and automatically extracted with the Sphinx extensions in the
:ref:`bokeh.sphinxext` module.


Basic Properties
----------------

.. autoclass:: Alpha
.. autoclass:: Angle
.. autoclass:: Any
.. autoclass:: AnyRef
.. autoclass:: Auto
.. autoclass:: Bool
.. autoclass:: Byte
.. autoclass:: Bytes
.. autoclass:: Color
.. autoclass:: Complex
.. autoclass:: CoordinateLike
.. autoclass:: DashPattern
.. autoclass:: Date
.. autoclass:: Datetime
.. autoclass:: Either
.. autoclass:: Enum
.. autoclass:: Float
.. autoclass:: FontSize
.. autoclass:: Image
.. autoclass:: Int
.. autoclass:: Interval
.. autoclass:: JSON
.. autoclass:: MarkerType
.. autoclass:: MinMaxBounds
.. autoclass:: NonNegative
.. autoclass:: NonNegativeInt
.. autoclass:: Nothing
.. autoclass:: Null
.. autoclass:: Percent
.. autoclass:: Positive
.. autoclass:: PositiveInt
.. autoclass:: RGB
.. autoclass:: Regex
.. autoclass:: Size
.. autoclass:: String
.. autoclass:: Struct
.. autoclass:: Time
.. autoclass:: TimeDelta

Container Properties
--------------------

.. autoclass:: Array
.. autoclass:: ColumnData
.. autoclass:: Dict
.. autoclass:: List
.. autoclass:: RelativeDelta
.. autoclass:: Seq
.. autoclass:: Set
.. autoclass:: Tuple
.. autoclass:: RestrictedDict

DataSpec Properties
-------------------

.. autoclass:: AlphaSpec
.. autoclass:: AngleSpec
.. autoclass:: ColorSpec
.. autoclass:: DataSpec
.. autoclass:: DistanceSpec
.. autoclass:: FontSizeSpec
.. autoclass:: MarkerSpec
.. autoclass:: NumberSpec
.. autoclass:: SizeSpec
.. autoclass:: StringSpec
.. autoclass:: UnitsSpec

Helpers
~~~~~~~

.. autofunction:: expr
.. autofunction:: field
.. autofunction:: value

Special Properties
------------------

.. autoclass:: Instance
.. autoclass:: InstanceDefault
.. autoclass:: Include
.. autoclass:: Nullable
.. autoclass:: NonNullable
.. autoclass:: NotSerialized
.. autoclass:: Object
.. autoclass:: Override
.. autoclass:: Required
.. autoclass:: TypeOfAttr

Validation-only Properties
--------------------------

.. autoclass:: PandasDataFrame
.. autoclass:: PandasGroupBy

Validation Control
------------------

By default, Bokeh properties perform type validation on values. This helps to
ensure the consistency of any data exchanged between Python and JavaScript, as
well as provide detailed and immediate feedback to users if they attempt to
set values of the wrong type. However, these type checks incur some overhead.
In some cases it may be desirable to turn off validation in specific places,
or even entirely, in order to boost performance. The following API is available
to control when type validation occurs.

.. autoclass:: validate
.. autofunction:: without_property_validation

    )annotationsN)`AliasAlpha	AlphaSpecAngle	AngleSpecAnyAnyRefArrayAutoBoolByteBytesColorColorHex	ColorSpec
ColumnDataComplexCoordinateLikeDashPatternDashPatternSpecDataSpecDateDatetimeDeprecatedAliasDictDistanceSpecEitherEnumFactor	FactorSeqFloatFontSizeFontSizeSpecFontStyleSpecHatchPatternSpecHatchPatternTypeImageIncludeInstanceInstanceDefaultIntIntSpecIntervalJSONLineCapSpecLineJoinSpecList
MarkerSpec
MarkerType
MathStringMinMaxBoundsNonEmptyNonNegativeNonNegativeIntNonNullableNotSerializedNothingNullNullDistanceSpecNullStringSpecNullable
NumberSpecObjectOverridePandasDataFramePandasGroupByPercentPositivePositiveIntRGBReadonlyRegexRelativeDeltaRequiredRestrictedDictSeqSetSizeSizeSpecString
StringSpecStructTime	TimeDeltaTextAlignSpecTextBaselineSpecTextLikeTuple
TypeOfAttr	UnitsSpecUnsetValueErrorexprfieldvalidatevaluewithout_property_validation   )r   r   )r   )r	   )r
   )r   )r   )r   )rI   )r   )r\   )r   )r   )r   )r2   )r7   )rO   )rP   )r[   )rL   )rN   )r   )r   )r   )r   )r   )r   )r$   )r%   )r&   )r-   )r0   )r1   )r3   )r>   )r?   )rA   )rR   )rT   )rX   )rY   )r]   )r   )r   )rV   )rW   )r^   )r   )r   )r    )r!   )r)   )r*   )r+   )rB   )r/   )r<   )r:   )r@   )r   )r   )r.   )r8   )r9   )rF   )rG   )rH   )rQ   )rC   )rD   )rE   )r   )r   )r   )r,   )r"   )r=   )rS   )rJ   )rM   )r;   )r5   )rK   )rU   )rZ   )r_   )r`   )rb   )r   )r#   )r'   )r(   )r6   )r4   )ra   )rc   )__doc__
__future__r   logging	getLogger__name__log__all__property.aliasr   r   property.aliasesr   property.anyr	   r
   property.autor   property.colorr   r   rI   r   property.constraintsr\   property.containerr   r   r   r2   r7   rO   rP   r[   rL   rN   property.dataspecr   r   r   r   r   r   r$   r%   r&   r-   r0   r1   r3   r>   r?   rA   rR   rT   rX   rY   r]   property.datetimer   r   rV   rW   property.descriptorsr^   property.eitherr   property.enumr   property.factorsr    r!   property.includer)   property.instancer*   r+   rB   property.jsonr/   property.nothingr<   property.nullabler:   r@   property.numericr   r   r.   r8   r9   rF   rG   rH   rQ   property.overriderC   property.pdrD   rE   property.primitiver   r   r   r,   r"   r=   rS   property.readonlyrJ   property.requiredrM   property.serializedr;   property.stringr5   rK   property.structrU   property.text_likerZ   property.vectorizationr_   r`   rb   property.visualr   r#   r'   r(   r6   r4   property.validationra   rc        5lib/python3.11/site-packages/bokeh/core/properties.py<module>r      s  o of # " " " " " g!!aN 3 2 2 2 2 2 2 2 , , , , , ,                         ! ! ! ! ! ! ! ! ! ! ! !       $ $ $ $ $ $ , , , , , , % % % % % % * * * * * * $ $ $ $ $ $ $ $ $ $ $ $ ( ( ( ( ( ( # # # # # # # # # # # # % % % % % % - - - - - - . . . . . . ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( . . . . . . ' ' ' ' ' ' + + + + + + + + + + + + , , , , , , / / / / / / & & & & & & * * * * * * + + + + + + ) ) ) ) ) ) / / / / / / - - - - - - ) ) ) ) ) ) ' ' ' ' ' ' ) ) ) ) ) ) , , , , , , / / / / / / ( ( ( ( ( ( # # # # # # ' ' ' ' ' ' # # # # # # ( ( ( ( ( ( 1 1 1 1 1 1 # # # # # #       $ $ $ $ $ $ ' ' ' ' ' ' % % % % % % ' ' ' ' ' ' . . . . . . % % % % % %       % % % % % % * * * * * * ' ' ' ' ' ' # # # # # # " " " " " " & & & & & & ) ) ) ) ) ) , , , , , , % % % % % % & & & & & & ) ) ) ) ) ) " " " " " " ' ' ' ' ' ' ( ( ( ( ( ( & & & & & & $ $ $ $ $ $ % % % % % % ' ' ' ' ' ' # # # # # # % % % % % % $ $ $ $ $ $ & & & & & & ' ' ' ' ' ' ' ' ' ' ' ' . . . . . . ' ' ' ' ' ' " " " " " " # # # # # # ( ( ( ( ( ( ( ( ( ( ( ( ) ) ) ) ) ) ) ) ) ) ) ) ( ( ( ( ( ( % % % % % % - - - - - - " " " " " " ) ) ) ) ) ) ' ' ' ' ' ' ) ) ) ) ) ) < < < < < < < <r   