U
    /e4,                     @  s  d Z ddlmZ ddlZeeZddlmZm	Z	m
Z
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mZmZ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Z,d	Z-d
Z.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dd8e	d8dd e
D f Z9d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Z?G d#d$ d$eZ@G d%d& d&eZAG d'd( d(eZBdS ))an   Mix-in classes that bulk add groups of properties to Bokeh models.

Some groups of properties often show up in Bokeh models together. For
instance, any model that exposes a fill color property for use when
rendering will almost always want to expose a fill alpha as well. To
reduce boilerplate code and simplify defining models with these sets
of properties, use the mix-in classes in this module:

* |FillProps| --- properties for fill color and alpha

* |HatchProps| --- properties for hatching pattern, color, alpha, etc.

* |LineProps| --- properties for line color, dashing, width, etc.

* |TextProps| --- properties for text color, font, etc.

To include these properties in a Bokeh model, use the |Include| property
as shown here:

.. code-block:: python

    class SomeGlyph(Glyph):

        fill_props = Include(FillProps, help="""
        The {prop} values for the annular wedges.
        """)

This adds all the fill properties ``fill_color`` and ``fill_alpha`` to this
model. The help string contains a placeholder `{prop}`. When docs for this class
are rendered by the, the placeholder will be replaced with more information
specific to each property.

.. |Include| replace:: :class:`~bokeh.core.properties.Include`

.. |FillProps| replace:: :class:`~bokeh.core.property_mixins.FillProps`
.. |HatchProps| replace:: :class:`~bokeh.core.property_mixins.HatchProps`
.. |LineProps| replace:: :class:`~bokeh.core.property_mixins.LineProps`
.. |TextProps| replace:: :class:`~bokeh.core.property_mixins.TextProps`

.. |miter_join| image:: /_images/miter_join.png
    :height: 15
.. |round_join| image:: /_images/round_join.png
    :height: 15
.. |bevel_join| image:: /_images/bevel_join.png
    :height: 15

.. |butt_cap| image:: /_images/butt_cap.png
    :height: 12
.. |round_cap| image:: /_images/round_cap.png
    :height: 12
.. |square_cap| image:: /_images/square_cap.png
    :height: 12

    )annotationsN   )	FontStyleHatchPatternHatchPatternAbbreviationLineCapLineJoin	TextAlignTextBaseline)HasProps)Alpha	AlphaSpecColor	ColorSpecDashPatternDashPatternSpecDictEnumFloatFontSizeFontSizeSpecFontStyleSpecHatchPatternSpecInstanceIntIntSpecLineCapSpecLineJoinSpecNullable
NumberSpecSizeString
StringSpecTextAlignSpecTextBaselineSpecvalue)	FillProps
HatchProps	LineProps	TextPropsScalarFillPropsScalarHatchPropsScalarLinePropsScalarTextPropsz
A color to use to %s with.
z#
An alpha value to use to %s with.
z"
Stroke width in units of pixels.
z
How path segments should be joined together.

Acceptable values are:

- ``'miter'`` |miter_join|
- ``'round'`` |round_join|
- ``'bevel'`` |bevel_join|

z
How path segments should be terminated.

Acceptable values are:

- ``'butt'`` |butt_cap|
- ``'round'`` |round_cap|
- ``'square'`` |square_cap|

zP
Name of a font to use for rendering text, e.g., ``'times'``, ``'helvetica'``.

z
A style to use for rendering text.

Acceptable values are:

- ``'normal'`` normal text
- ``'italic'`` *italic text*
- ``'bold'`` **bold text**
- ``"bold italic"`` ***bold italic text***

zy
Horizontal anchor point to use when rendering text.

Acceptable values are:

- ``'left'``
- ``'right'``
- ``'center'``

z
Vertical anchor point to use when rendering text.

Acceptable values are:

- ``'top'``
- ``'middle'``
- ``'bottom'``
- ``'alphabetic'``
- ``'hanging'``
- ``'ideographic'``

a  
In multi-line text, how much additional space should be allocated for
each line. The value is provided as a number, but should be treated as
a percentage of font size. The default is 120%. Setting it to 1.0, so
100%, means no additional space will be used.
z
A rough measure of the 'size' of the hatching pattern. Generally speaking, the
higher the number, the more spread out the pattern will be.
zg
Built-in patterns are can either be specified as long names:

%s

or as one-letter abbreviations:

%s
z, c                 c  s   | ]}t |V  qd S )N)repr).0x r1   >/tmp/pip-unpacked-wheel-f5fndrjf/bokeh/core/property_mixins.py	<genexpr>   s     r3   z2
A width value for line-strokes used in hatching.
c                   @  s.   e Zd ZdZeded dZeed dZ	dS )r&   zo Properties relevant to rendering fill regions.

    Mirrors the BokehJS ``properties.FillVector`` class.

    gray
fill pathsdefaulthelpr8   N)
__name__
__module____qualname____doc__r   _color_help
fill_colorr   _alpha_help
fill_alphar1   r1   r1   r2   r&      s   r&   c                   @  s,   e Zd ZdZeeded dZee	dZ
dS )r*   zi Properties relevant to rendering fill regions.

    Mirrors the BokehJS ``properties.Fill`` class.

    r4   r5   r6   r9   N)r:   r;   r<   r=   r   r   r>   r?   r   r@   rA   r1   r1   r1   r2   r*      s   r*   c                   @  sh   e Zd ZdZeded dZeed dZ	e
dddedZed	edZe
d
ddedZeeedZd	S )r'   zp Properties relevant to rendering fill regions.

    Mirrors the BokehJS ``properties.HatchVector`` class.

    blackhatchingr6   r9         (@Fr7   Zaccept_datetimeZaccept_timedeltar8   N      ?bokeh.models.textures.Texture)r:   r;   r<   r=   r   r>   hatch_colorr   r@   hatch_alphar   _hatch_scale_helphatch_scaler   _hatch_pattern_helphatch_pattern_hatch_weight_helphatch_weightr   r!   r   hatch_extrar1   r1   r1   r2   r'     s   r'   c                   @  sb   e Zd ZdZeeded dZee	d dZ
ededZeeedZededZeeedZd	S )
r+   zj Properties relevant to rendering fill regions.

    Mirrors the BokehJS ``properties.Hatch`` class.

    rB   rC   r6   r9   rD   rF   rG   N)r:   r;   r<   r=   r   r   r>   rH   r   r@   rI   r    rJ   rK   r!   rL   rM   rN   rO   r   r   rP   r1   r1   r1   r2   r+     s   r+   c                   @  sn   e Zd ZdZeded dZeed dZ	e
dddedZed	edZed
edZeg ddZedddZdS )r(   zr Properties relevant to rendering path operations.

    Mirrors the BokehJS ``properties.LineVector`` class.

    rB   stroke pathsr6   r9   r   FrE   bevelbuttHow should the line be dashed.r   SThe distance into the ``line_dash`` (in pixels) that the pattern should start from.N)r:   r;   r<   r=   r   r>   
line_colorr   r@   
line_alphar   _line_width_help
line_widthr   _line_join_help	line_joinr   _line_cap_helpline_capr   	line_dashr   line_dash_offsetr1   r1   r1   r2   r(     s   r(   c                   @  sp   e Zd ZdZeeded dZee	d dZ
ededZeededZeededZeg d	dZed
ddZdS )r,   zl Properties relevant to rendering path operations.

    Mirrors the BokehJS ``properties.Line`` class.

    rB   rQ   r6   r9   r   rR   rS   rT   r   rU   N)r:   r;   r<   r=   r   r   r>   rV   r   r@   rW   r   rX   rY   r   r   rZ   r[   r   r\   r]   r   r^   r   r_   r1   r1   r1   r2   r,   .  s   r,   c                   @  s|   e Zd ZdZeded dZeed dZ	e
ededZeeddZed	edZed
edZededZededZdS )r)   z Properties relevant to rendering text.

    Mirrors the BokehJS ``properties.TextVector`` class.

    .. note::
        There is currently only support for filling text. An interface
        to stroke the outlines of text has not yet been exposed.

    #444444	fill textr6   r9   	helvetica16px)r7   normalleftbottom333333?N)r:   r;   r<   r=   r   r>   
text_colorr   r@   
text_alphar"   r%   _text_font_help	text_fontr   text_font_sizer   _text_font_style_helptext_font_styler#   _text_align_help
text_alignr$   _text_baseline_helptext_baseliner   _text_line_height_helptext_line_heightr1   r1   r1   r2   r)   >  s   
r)   c                   @  sz   e Zd ZdZeeded dZee	d dZ
ededZedZeededZeed	edZeed
edZededZdS )r-   z Properties relevant to rendering text.

    Mirrors the BokehJS ``properties.Text`` class.

    .. note::
        There is currently only support for filling text. An interface
        to stroke the outlines of text has not yet been exposed.

    r`   ra   r6   r9   rb   rc   rd   re   rf   rg   N)r:   r;   r<   r=   r   r   r>   rh   r   r@   ri   r!   rj   rk   r   rl   r   r   rm   rn   r	   ro   rp   r
   rq   rr   r   rs   rt   r1   r1   r1   r2   r-   R  s   
r-   )Cr=   
__future__r   logging	getLoggerr:   logenumsr   r   r   r   r   r	   r
   Z	has_propsr   Z
propertiesr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   __all__r>   r@   rX   rZ   r\   rj   rm   ro   rq   rs   rJ   joinrL   rN   r&   r*   r'   r+   r(   r,   r)   r-   r1   r1   r1   r2   <module>   s<   9
$	p!


