ó
mÜJ]c           @` sÑ   d  Z  d d l m Z m Z m Z m Z d d l Z e j e ƒ Z	 d d l
 m Z d d l m Z m Z m Z d d l m Z d Z e d e f d „  ƒ  Yƒ Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d S(   ug   Represent array expressions to be computed on the client (browser) side
by BokehJS.

Expression models are useful as ``DataSpec`` values when it is desired that
the array values be computed in the browser:

.. code-block:: python

    p.circle(x={'expr': some_expression}, ...)

or using the ``expr`` convenience function:

.. code-block:: python

    from bokeh.core.properties import expr

    p.circle(x=expr(some_expression), ...)

In this case, the values of the ``x`` coordinates will be computed in the
browser by the JavaScript implementation of ``some_expression`` using a
``ColumnDataSource`` as input.

i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsNi   (   t   abstract(   t   Boolt   Seqt   String(   t   Modelu   CumSumu
   Expressionu   Stackt
   Expressionc           B` s   e  Z d  Z RS(   uÈ   Base class for ``Expression`` models that represent a computation
    to be carried out on the client-side.

    JavaScript implementations should implement the following methods:

    .. code-block:: coffeescript

        v_compute: (source) ->
            # compute an array of values

    .. note::
        If you wish for results to be cached per source and updated only if
        the source changes, implement ``_v_compute: (source)`` instead.

    (   t   __name__t
   __module__t   __doc__(    (    (    s7   lib/python2.7/site-packages/bokeh/models/expressions.pyR	   B   s   t   CumSumc           B` s2   e  Z d  Z e d d ƒ Z e d e d d ƒ Z RS(   us    An expression for generating arrays by cumulatively summing a single
    column from a ``ColumnDataSource``.

    t   helpuW   
    The name of a ``ColumnDataSource`` column to cumulatively sum for new values.
    t   defaultuÚ  
    Whether to include zero at the start of the result. Note that the length
    of the result is always the same as the input column. Therefore if this
    property is True, then the last value of the column will not be included
    in the sum.

    .. code-block:: python

        source = ColumnDataSource(data=dict(foo=[1, 2, 3, 4]))

        CumSum(field='foo')
        # -> [1, 3, 6, 10]

        CumSum(field='foo', include_zero=True)
        # -> [0, 1, 3, 6]

    (   R
   R   R   R   t   fieldR   t   Falset   include_zero(    (    (    s7   lib/python2.7/site-packages/bokeh/models/expressions.pyR   U   s
   	t   Stackc           B` s&   e  Z d  Z e e d g  d d ƒZ RS(   u¿    An expression for generating arrays by summing different columns from
    a ``ColumnDataSource``.

    This expression is useful for implementing stacked bar charts at a low
    level.

    R   R   u=  
    A sequence of fields from a ``ColumnDataSource`` to sum (elementwise). For
    example:

    .. code-block:: python

        Stack(fields=['sales', 'marketing'])

    Will compute an array of values (in the browser) by adding the elements
    of the ``'sales'`` and ``'marketing'`` columns of a data source.
    (   R
   R   R   R   R   t   fields(    (    (    s7   lib/python2.7/site-packages/bokeh/models/expressions.pyR   q   s   
(   u   CumSumu
   Expressionu   Stack(   R   t
   __future__R    R   R   R   t   loggingt	   getLoggerR
   t   logt   core.has_propsR   t   core.propertiesR   R   R   t   modelR   t   __all__R	   R   R   (    (    (    s7   lib/python2.7/site-packages/bokeh/models/expressions.pyt   <module>   s   "  