U
    /e+                     @  sv  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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dl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	dl*m+Z+ d	dl,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3 dZ4e
G dd de+Z5e
G dd de5Z6G dd de6Z7G dd de6Z8G dd de5Z9G dd de7Z:G dd de7Z;dS )zM Guide renderers for various kinds of axes that can be added to
Bokeh plots

    )annotationsN   )TickLabelOrientation)abstract)AutoDatetimeDictEitherEnumFactorFloatIncludeInstanceIntNullNullableOverrideSeqStringTextLikeTuple)ScalarLinePropsScalarTextProps   )BasicTickFormatterCategoricalTickFormatterDatetimeTickFormatterLogTickFormatterMercatorTickFormatterTickFormatter)	AllLabelsLabelingPolicy)GuideRenderer)BasicTickerCategoricalTickerDatetimeTickerFixedTicker	LogTickerMercatorTickerTicker)AxisCategoricalAxisContinuousAxisDatetimeAxis
LinearAxisLogAxisMercatorAxisc                   @  sl  e Zd ZdZeeeeeeeeddZ	e
eddeedd Ze
eddZeeddZed	d
dZeedddZeddZeddZed	ddZeeddeddZeeee ei ddZ!e
e"dd ddZ#eedddZ$eddZ%eddZ&eddZ'ee(dddZ)ee(d d!dZ*ed"d#dZ+ed$d%dZ,ee(d&d'dZ-ed(d)dZ.ed*d%dZ/ee0ee1d+dZ2d,S )-r*   zF A base class that defines common properties for all axis types.

    zp
    Bounds for the rendered axis. If unset, the axis will span the
    entire plot in the given dimension.
    )helpaP  
    A Ticker to use for computing locations of axis components.

    The property may also be passed a sequence of floating point numbers as
    a shorthand for creating and configuring a ``FixedTicker``, e.g. the
    following code

    .. code-block:: python

        from bokeh.plotting import figure

        p = figure()
        p.xaxis.ticker = [10, 20, 37.4]

    is equivalent to:

    .. code-block:: python

        from bokeh.plotting import figure
        from bokeh.models import FixedTicker

        p = figure()
        p.xaxis.ticker = FixedTicker(ticks=[10, 20, 37.4])

    c                 C  s
   t | dS )NZticks)r&   r2    r3   5/tmp/pip-unpacked-wheel-f5fndrjf/bokeh/models/axes.py<lambda>x       zAxis.<lambda>zW
    A ``TickFormatter`` to use for formatting the visual appearance
    of ticks.
    z[
    A text or LaTeX notation label for the axis, displayed parallel to the axis rule.
       z`
    The distance in pixels that the axis labels should be offset
    from the tick labels.
    defaultr1   
axis_labelz'
    The {prop} of the axis label.
    prefixr1   Z13pxr9   Zitaliczk
    The distance in pixels that the major tick labels should be
    offset from the associated ticks.
    Z
horizontalZverticalz
    What direction the major label text should be oriented. If a
    number is supplied, the angle of the text is measured from horizontal.
    zm
    Provide explicit tick label values for specific tick locations that
    override normal formatting.
    c                   C  s   t  S N)r    r3   r3   r3   r4   r5      r6   zN
    Allows to filter out labels, e.g. declutter labels to avoid overlap.
    Zmajor_labelz.
    The {prop} of the major tick labels.
    centerZ
alphabetic11pxZaxisz&
    The {prop} of the axis line.
    Z
major_tickz(
    The {prop} of the major ticks.
    r   z\
    The distance in pixels that major ticks should extend into the
    main plot area.
       z^
    The distance in pixels that major ticks should extend out of the
    main plot area.
    Z
minor_tickz(
    The {prop} of the minor ticks.
    r   z\
    The distance in pixels that minor ticks should extend into the
    main plot area.
       a4  
    Set to specify a fixed coordinate location to draw the axis. The direction
    of ticks and major labels is determined by the side panel that the axis
    belongs to.

    .. note::
        Axes labels are suppressed when axes are positioned at fixed locations
        inside the central plot area.
    N)3__name__
__module____qualname____doc__r	   r   r   r   r   Zboundsr   r)   Zacceptsr   tickerr   	formatterr   r   r:   r   Zaxis_label_standoffr   r   Zaxis_label_propsr   Zaxis_label_text_font_sizeZaxis_label_text_font_styleZmajor_label_standoffr
   Zmajor_label_orientationr   r   Zmajor_label_overridesr!   Zmajor_label_policyZmajor_label_propsZmajor_label_text_alignZmajor_label_text_baselineZmajor_label_text_font_sizer   Z
axis_propsZmajor_tick_propsZmajor_tick_inZmajor_tick_outZminor_tick_propsZminor_tick_inZminor_tick_outr   r   Zfixed_locationr3   r3   r3   r4   r*   U   s8    




r*   c                   @  s   e Zd ZdZdS )r,   z@ A base class for all numeric, non-categorical axes types.

    N)rC   rD   rE   rF   r3   r3   r3   r4   r,      s   r,   c                   @  s,   e Zd ZdZedd dZedd dZdS )r.   z An axis that picks nice numbers for tick locations on a
    linear scale. Configured with a ``BasicTickFormatter`` by default.

    c                   C  s   t  S r>   )r#   r3   r3   r3   r4   r5      r6   zLinearAxis.<lambda>r=   c                   C  s   t  S r>   )r   r3   r3   r3   r4   r5      r6   NrC   rD   rE   rF   r   rG   rH   r3   r3   r3   r4   r.      s   r.   c                   @  s,   e Zd ZdZedd dZedd dZdS )r/   z An axis that picks nice numbers for tick locations on a
    log scale. Configured with a ``LogTickFormatter`` by default.

    c                   C  s   t  S r>   )r'   r3   r3   r3   r4   r5      r6   zLogAxis.<lambda>r=   c                   C  s   t  S r>   )r   r3   r3   r3   r4   r5      r6   NrI   r3   r3   r3   r4   r/      s   r/   c                   @  s   e Zd ZdZedd dZedd dZeedddZ	ed	dZ
ed
dZeedddZeeeedddZeddZeddZeddZeedddZeeeedddZeddZeddZdS )r+   z An axis that displays ticks and labels for categorical ranges.

    The ``CategoricalAxis`` can handle factor ranges with up to two levels of
    nesting, including drawing a separator line between top-level groups of
    factors.

    c                   C  s   t  S r>   )r$   r3   r3   r3   r4   r5      r6   zCategoricalAxis.<lambda>r=   c                   C  s   t  S r>   )r   r3   r3   r3   r4   r5      r6   	separatorz
    The {prop} of the separator line between top-level categorical groups.

    This property always applies to factors in the outermost level of nesting.
    r;   Z	lightgreyr   groupz
    The {prop} of the group categorical labels.

    This property always applies to factors in the outermost level of nesting.
    If the list of categorical factors is flat (i.e. no nesting) then this
    property has no effect.
    parallelaI  
    What direction the group label text should be oriented.

    If a number is supplied, the angle of the text is measured from horizontal.

    This property always applies to factors in the outermost level of nesting.
    If the list of categorical factors is flat (i.e. no nesting) then this
    property has no effect.
    r8   r@   ZboldZgreyZsubgroupz
    The {prop} of the subgroup categorical labels.

    This property always applies to factors in the middle level of nesting.
    If the list of categorical factors is has only zero or one levels of nesting,
    then this property has no effect.
    aZ  
    What direction the subgroup label text should be oriented.

    If a number is supplied, the angle of the text is measured from horizontal.

    This property always applies to factors in the middle level of nesting.
    If the list of categorical factors is has only zero or one levels of nesting,
    then this property has no effect.
    N)rC   rD   rE   rF   r   rG   rH   r   r   Zseparator_propsZseparator_line_colorZseparator_line_widthr   Zgroup_propsr	   r
   r   r   Zgroup_label_orientationZgroup_text_font_sizeZgroup_text_font_styleZgroup_text_colorZsubgroup_propsZsubgroup_label_orientationZsubgroup_text_font_sizeZsubgroup_text_font_styler3   r3   r3   r4   r+      s   







r+   c                   @  s,   e Zd ZdZedd dZedd dZdS )r-   z A ``LinearAxis`` that picks nice numbers for tick locations on
    a datetime scale. Configured with a ``DatetimeTickFormatter`` by
    default.

    c                   C  s   t  S r>   )r%   r3   r3   r3   r4   r5   7  r6   zDatetimeAxis.<lambda>r=   c                   C  s   t  S r>   )r   r3   r3   r3   r4   r5   9  r6   NrI   r3   r3   r3   r4   r-   0  s   r-   c                      sD   e Zd ZdZddd fddZedd d	Zed
d d	Z  ZS )r0   a*   An axis that picks nice numbers for tick locations on a
    Mercator scale. Configured with a ``MercatorTickFormatter`` by default.

    Args:
        dimension ('lat' or 'lon', optional) :
            Whether this axis will display latitude or longitude values.
            (default: 'lat')

    latNone)returnc                   s:   t  jf | t| jtr"|| j_t| jtr6|| j_d S r>   )super__init__
isinstancerG   r(   	dimensionrH   r   )selfrS   kw	__class__r3   r4   rQ   E  s
    zMercatorAxis.__init__c                   C  s   t  S r>   )r(   r3   r3   r3   r4   r5   O  r6   zMercatorAxis.<lambda>r=   c                   C  s   t  S r>   )r   r3   r3   r3   r4   r5   Q  r6   )rM   )	rC   rD   rE   rF   rQ   r   rG   rH   __classcell__r3   r3   rV   r4   r0   ;  s   	
r0   )<rF   
__future__r   logging	getLoggerrC   logZ
core.enumsr   Zcore.has_propsr   Zcore.propertiesr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   Zcore.property_mixinsr   r   
formattersr   r   r   r   r   r   Zlabelingr    r!   Z	renderersr"   Ztickersr#   r$   r%   r&   r'   r(   r)   __all__r*   r,   r.   r/   r+   r-   r0   r3   r3   r3   r4   <module>   s,   
L $ 		@