ó
mÜJ]c           @` s  d  Z  d d l m Z m Z m Z m Z d d l m Z d d l Z e j	 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 d d	 l m Z d d
 l m Z m Z m Z m Z m  Z  d d l! m" Z" d d l# m$ Z$ m% Z% m& Z& d d l' m( Z( m) Z) m* Z* d d l+ m, Z, m- Z- m. Z. m/ Z/ d d l0 m1 Z1 m2 Z2 d% Z3 e d e" f d „  ƒ  Yƒ Z4 e d e4 f d „  ƒ  Yƒ Z5 d e5 f d „  ƒ  YZ6 d e5 f d „  ƒ  YZ7 d „  Z8 d  „  Z9 d! e5 f d" „  ƒ  YZ: e d# e4 f d$ „  ƒ  Yƒ Z; d S(&   u\    Models (mostly base classes) for the various kinds of renderer
types that Bokeh supports.

i    (   t   absolute_importt   divisiont   print_functiont   unicode_literals(   t   get_close_matchesNi   (   t   RenderLevel(   t   abstract(   t   Autot   Boolt   Eithert   Enumt   Floatt   Instancet   Overridet   String(   t   error(   t   BAD_COLUMN_NAMEt   MISSING_GLYPHt   NO_SOURCE_FOR_GLYPHt   CDSVIEW_SOURCE_DOESNT_MATCHt   MALFORMED_GRAPH_SOURCE(   t   Modeli   (   t   Glypht   Circlet	   MultiLine(   t   LayoutProvidert   GraphHitTestPolicyt	   NodesOnly(   t   ColumnDataSourcet
   DataSourcet	   WebSourcet   CDSView(   t
   TileSourcet   WMTSTileSourceu   DataRendereru   GlyphRendereru   GraphRendereru   GuideRendereru   Rendereru   TileRenderert   Rendererc           B` s5   e  Z d  Z e e d d ƒZ e d e d d ƒ Z RS(   u0   An abstract base class for renderer types.

    t   helpu>   
    Specifies the level in which to paint this renderer.
    t   defaultu"   
    Is the renderer visible.
    (	   t   __name__t
   __module__t   __doc__R
   R   t   levelR   t   Truet   visible(    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyR"   ?   s
   		t   DataRendererc           B` sA   e  Z d  Z e d d ƒ Z e d d d ƒZ e d d d ƒZ RS(   ut    An abstract base class for data renderer types (e.g. ``GlyphRenderer``, ``TileRenderer``, ``GraphRenderer``).

    R$   u   glyphu   defaultR#   u–   
    A particular (named) x-range to use for computing screen locations when
    rendering glyphs on the plot. If unset, use the default x-range.
    u–   
    A particular (named) y-range to use for computing screen locations when
    rendering glyphs on the plot. If unset, use the default y-range.
    (   R%   R&   R'   R   R(   R   t   x_range_namet   y_range_name(    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyR+   M   s   			t   TileRendererc           B` se   e  Z d  Z e e d d „  d d ƒZ e d d d ƒZ e d e	 d d ƒ Z
 e d e	 d d ƒ Z RS(	   u   

    R$   c           C` s   t  ƒ  S(   N(   R!   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyt   <lambda>d   t    R#   uE   
    Local data source to use when rendering glyphs on the plot.
    g      ð?u    
    tile opacity 0.0 - 1.0
    u8   
    Enable image smoothing for the rendered tiles.
    us   
    Flag enable/disable drawing of parent tiles while waiting for new tiles to arrive. Default value is True.
    (   R%   R&   R'   R   R    t   tile_sourceR   t   alphaR   R)   t	   smoothingt   render_parents(    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyR.   _   s   				t   GlyphRendererc           B` s  e  Z d  Z e e ƒ d „  ƒ Z e e ƒ d „  ƒ Z e e ƒ d „  ƒ Z	 e e
 ƒ d „  ƒ Z d „  Z e e d d ƒZ e e d d ƒZ e e d d	 ƒZ e e e e ƒ d
 d d d ƒZ e e e e ƒ d
 d d d ƒZ e e d d ƒZ e e d d ƒZ e e d d ƒZ RS(   u   

    c         C` s   |  j  s t |  ƒ Sd  S(   N(   t   glypht   str(   t   self(    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyt   _check_missing_glyphy   s    	 c         C` s   |  j  s t |  ƒ Sd  S(   N(   t   data_sourceR7   (   R8   (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyt   _check_no_source_for_glyph}   s    	 c         C` s#   |  j  |  j j k	 r t |  ƒ Sd  S(   N(   R:   t   viewt   sourceR7   (   R8   (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyt   _check_cdsview_source   s     c         C` sÝ  |  j  s d  S|  j s d  St |  j t ƒ r0 d  St ƒ  } |  j  j ƒ  } x¤ |  j  j d t ƒ j ƒ  D]‡ \ } } | | k r‚ qd n  t | t	 ƒ s— qd n  t |  j t
 ƒ s¯ qd n  d | k rd | d |  j j k rd | j | d | f ƒ qd qd W| rÙg  g  | D]% } t | d |  j j d d ƒ^ qÿ D]  } | rBd | d n d ^ q(} g  t | | ƒ D]/ \ } } d j | d | g ƒ | d f ^ q^} g  | D] \ }	 }
 d	 |
 |	 f ^ qš} d
 d j t | ƒ ƒ |  f Sd  S(   Nt   include_defaultsu   fieldi    t   ni   u   " (closest match: "%s")u   "u    u   key "%s" value "%su   %s [renderer: %s]u   , (   R6   R:   t
   isinstanceR   t   sett	   dataspecst   properties_with_valuest   Falset   itemst   dictR   t   column_namest   addR   t   zipt   joint   sorted(   R8   t   missing_valuest   specst   namet   itemt   termt   st   suggestionst   mt   vt   kt   missing(    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyt   _check_bad_column_name…   s.    	 	  	(   "VE)c         K` s>   t  t |  ƒ j |   d | k r: t d |  j ƒ |  _ n  d  S(   Nu   viewR=   (   t   superR5   t   __init__R   R:   R<   (   R8   t   kw(    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyRZ   ™   s    R#   uE   
    Local data source to use when rendering glyphs on the plot.
    u³   
    A view into the data source to use when rendering glyphs. A default view
    of the entire data source is created when a view is not passed in during
    initialization.
    u[   
    The glyph to render, in conjunction with the supplied data source
    and ranges.
    R$   u   autou‰   
    An optional glyph used for selected points.

    If set to "auto" then the standard glyph will be used for selected
    points.
    u%  
    An optional glyph used for explicitly non-selected points
    (i.e., non-selected when there are other points that are selected,
    but not when no points at all are selected.)

    If set to "auto" then a glyph with a low alpha value (0.1) will
    be used for non-selected points.
    uv   
    An optional glyph used for inspected points, e.g., those that are
    being hovered over by a ``HoverTool``.
    u   
    (   R%   R&   R'   R   R   R9   R   R;   R   R>   R   RX   RZ   R   R   R:   R   R<   R   R6   R	   R   t   selection_glypht   nonselection_glypht   hover_glypht   muted_glyphR   RE   t   muted(    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyR5   t   s,   														c        	   C` s(   t  d t ƒ  d t d t d g  ƒ ƒ ƒ S(   NR6   R:   t   datat   index(   R5   R   R   RG   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyR/   È   s   c           C` s.   t  d t ƒ  d t d t d g  d g  ƒ ƒ ƒ S(   NR6   R:   Ra   t   startt   end(   R5   R   R   RG   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyR/   Ì   s   t   GraphRendererc           B` s›   e  Z d  Z e e ƒ d „  ƒ Z e e d d ƒZ e e	 d e
 d d ƒZ e e	 d e d d ƒZ e e d d „  d d ƒZ e e d d	 „  d d
 ƒZ RS(   u   

    c         C` s”   g  } d |  j  j j k r+ | j d ƒ n  d |  j j j k rP | j d ƒ n  d |  j j j k ru | j d ƒ n  | r d j | ƒ d |  Sd  S(	   Nu   indexuB   Column 'index' is missing in GraphSource.node_renderer.data_sourceu   startuB   Column 'start' is missing in GraphSource.edge_renderer.data_sourceu   endu@   Column 'end' is missing in GraphSource.edge_renderer.data_sourceu    ,u    [%s](   t   node_rendererR:   RH   t   appendt   edge_rendererRK   (   R8   RW   (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyt   _check_malformed_graph_sourceÕ   s    R#   us   
    An instance of a ``LayoutProvider`` that supplies the layout of the network
    graph in cartesian space.
    R$   uq   
    Instance of a ``GlyphRenderer`` containing an ``XYGlyph`` that will be rendered
    as the graph nodes.
    uy   
    Instance of a ``GlyphRenderer`` containing an ``MultiLine`` Glyph that will be
    rendered as the graph edges.
    c           C` s   t  ƒ  S(   N(   R   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyR/   ð   R0   up   
    An instance of a ``GraphHitTestPolicy`` that provides the logic for selection
    of graph components.
    c           C` s   t  ƒ  S(   N(   R   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyR/   õ   R0   uq   
    An instance of a ``GraphHitTestPolicy`` that provides the logic for inspection
    of graph components.
    (   R%   R&   R'   R   R   Ri   R   R   t   layout_providerR5   t   _DEFAULT_NODE_RENDERERRf   t   _DEFAULT_EDGE_RENDERERRh   R   t   selection_policyt   inspection_policy(    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyRe   Ð   s   					t   GuideRendererc           B` s   e  Z d  Z e d d ƒ Z RS(   uz    A base class for all guide renderer types. ``GuideRenderer`` is
    not generally useful to instantiate on its own.

    R$   u   overlay(   R%   R&   R'   R   R(   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyRo   ú   s   (   u   DataRendereru   GlyphRendereru   GraphRendereru   GuideRendereru   Rendereru   TileRenderer(<   R'   t
   __future__R    R   R   R   t   difflibR   t   loggingt	   getLoggerR%   t   logt
   core.enumsR   t   core.has_propsR   t   core.propertiesR   R   R	   R
   R   R   R   R   t   core.validationR   t   core.validation.errorsR   R   R   R   R   t   modelR   t   glyphsR   R   R   t   graphsR   R   R   t   sourcesR   R   R   R   t   tilesR    R!   t   __all__R"   R+   R.   R5   Rk   Rl   Re   Ro   (    (    (    s5   lib/python2.7/site-packages/bokeh/models/renderers.pyt   <module>
   s>   ":("     T		*