
    chO&                         S SK r S SKrSSKJr  SSKJr  SSKJr  SSKJr	  SSK
Jr  SS	KJr  SS
KJr  SSKJrJr  S rS\R(                  ;   r " S S\5      rg)    N   )	JSONMixin)Layer   )deck_to_html)settings)View)	ViewState)BaseMapProvider)DARKget_from_map_identifierc                  L     SSK Jn   U " 5         g! [        [        4 a     gf = f)Nr   DeckGLWidgetTF)widgetr   ImportErrorNotImplementedErrorr   s    gC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\pydeck/bindings/deck.pyhas_jupyter_extrar      s*    ),- s    ##zgoogle.colabc                       \ rS rSrS\" SSS9/\S\" SSSS9S	S
SSS\R                  R                  S4S jr
\S 5       rSS\4S jjrS rS r       SS jrS rSrg)Deck   NMapViewT)type
controllerr   r   )latitude	longitudezoom100%  c                 F   / U l         [        U[        5      (       a  U R                   R                  U5        OU=(       d    / U l         X l        XPl        U=(       d    0 nXl        Xl        U(       a  [        U5      R                  5       OSU l
        Xl        [        5       (       a  SSKJn  U" 5       U l        [         R"                  U R                  l        [         R$                  U R                  l        XpR                  l        X`R                  l        XR                  l        XR                  l
        U R-                  U5        Sn[        U[.        5      (       a,  U[0        R2                  R4                  :X  d   U5       eX0l        O[9        X;5      U l        Xl        g)a	  This is the renderer and configuration for a deck.gl visualization, similar to the
`Deck <https://deck.gl/docs/api-reference/core/deck>`_ class from deck.gl.
Pass `Deck` a Mapbox API token to display a basemap; see the notes below.

Parameters
----------

layers : pydeck.Layer or list of pydeck.Layer, default None
    List of :class:`pydeck.bindings.layer.Layer` layers to render.
views : list of pydeck.View, default ``[pydeck.View(type="MapView", controller=True)]``
    List of :class:`pydeck.bindings.view.View` objects to render.
api_keys : dict, default None
    Dictionary of geospatial API service providers, where the keys are ``mapbox``, ``google_maps``, or ``carto``
    and the values are the API key. Defaults to None if not set. Any of the environment variables
    ``MAPBOX_API_KEY``, ``GOOGLE_MAPS_API_KEY``, and ``CARTO_API_KEY`` can be set instead of hardcoding the key here.
map_provider : str, default 'carto'
    If multiple API keys are set (e.g., both Mapbox and Google Maps), inform pydeck which basemap provider to prefer.
    Values can be ``carto``, ``mapbox`` or ``google_maps``
map_style : str or dict, default 'dark'
    One of 'light', 'dark', 'road', 'satellite', 'dark_no_labels', and 'light_no_labels', a URI for a basemap
    style, which varies by provider, or a dict that follows the Mapbox style `specification <https://docs.mapbox.com/mapbox-gl-js/style-spec/>`.
    The default is Carto's Dark Matter map. For Mapbox examples, see  Mapbox's `gallery <https://www.mapbox.com/gallery/>`.
    If not using a basemap, set ``map_provider=None``.
initial_view_state : pydeck.ViewState, default ``pydeck.ViewState(latitude=0, longitude=0, zoom=1)``
    Initial camera angle relative to the map, defaults to a fully zoomed out 0, 0-centered map
    To compute a viewport from data, see :func:`pydeck.data_utils.viewport_helpers.compute_view`
height : int, default 500
    Height of Jupyter notebook cell, in pixels.
width : int` or string, default '100%'
    Width of visualization, in pixels (if a number) or as a CSS value string.
tooltip : bool or dict of {str: str}, default True
    If ``True``/``False``, toggles a default tooltip on visualization hover.
    Layers must have ``pickable=True`` set in order to display a tooltip.
    For more advanced usage, the user can pass a dict to configure more custom tooltip features.
    Further documentation is `here <tooltip.html>`_.

.. _Deck:
    https://deck.gl/docs/api-reference/core/deck
.. _gallery:
    https://www.mapbox.com/gallery/
Nr   r   zQThe map_provider parameter must be 'mapbox' when map_style is provided as a dict.)layers
isinstancer   appendviewsinitial_view_statedescriptioneffectsstrlowermap_provider_tooltipr   r   r   deck_widgetpydeck_settingscustom_librariesconfigurationheightwidthtooltip_set_api_keysdictr   MAPBOXvalue	map_styler   
parameters)selfr"   r%   r8   api_keysr&   r2   r1   r3   r'   r(   r+   r9   r   custom_map_style_errors                  r   __init__Deck.__init__   s9   p fe$$KKv& ,BDK
"4>r&9EC-3354-+~D0?0P0PD--<-J-JD*&,#%*"'.$,8)8$!ti&&?#9#9#?#??WAWW?&N4YMDN$    c                 f    U R                   R                  (       d  g U R                   R                  $ N)r-   selected_datar:   s    r   rB   Deck.selected_data|   s&    -----r?   r;   c                 p   U H  nU=(       a    [        U5        M    M     [          H  nUR                   S3nUR                   S3nUR                  UR                  5      =(       d    [        R
                  " U5      n[        XU5        [        5       (       d  Mv  [        U R                  XF5        M     g)zQSets API key for base map provider for both HTML embedding and the Jupyter widget_key_API_KEYN)	r   r7   namegetosgetenvsetattrr   r-   )r:   r;   kprovider	attr_nameprovider_env_var
attr_values          r   r4   Deck._set_api_keys   s    A$/!$$ 'H#>>*$/I"*--9!hnn5TCS9TJDZ0 ""(()@ (r?   c                      U R                  SS9$ )z2Display current Deck object for a Jupyter notebookTnotebook_display)to_htmlrC   s    r   show	Deck.show   s     ||T|22r?   c                     [        S5      e)zUpdate a deck.gl map to reflect the current configuration

For example, if you've modified data passed to Layer and rendered the map using `.show()`,
you can call `update` to change the data on the map.

Intended for use in a Jupyter environment.
zAJupyter-specific features not currently supported in pydeck v0.9.)r   rC   s    r   updateDeck.update   s    , "O
 	
r?   c                     U R                  5       n	[        U	4U R                  U R                  UUUUUU R                  [
        R                  [
        R                  UUS.UD6n
U
$ )a  Write a file and loads it to an iframe, if in a Jupyter environment;
otherwise, write a file and optionally open it in a web browser

Parameters
----------
filename : str, default None
    Name of the file.
open_browser : bool, default False
    Whether a browser window will open or not after write.
notebook_display : bool, default None
    Display the HTML output in an iframe if True. Set to True automatically if rendering in Jupyter.
iframe_width : str or int, default '100%'
    Width of Jupyter notebook iframe in pixels, if rendered in a Jupyter environment.
iframe_height : int, default 500
    Height of Jupyter notebook iframe in pixels, if rendered in Jupyter or Colab.
as_string : bool, default False
    Returns HTML as a string, if True and ``filename`` is None.
css_background_color : str, default None
    Background color for visualization, specified as a string in any format accepted for CSS colors.

Returns
-------
str
    Returns absolute path of the file
)
mapbox_keygoogle_maps_keyfilenameopen_browserrU   iframe_heightiframe_widthr3   r/   r0   	as_stringoffline)to_jsonr   r]   r^   r,   r.   r/   r0   )r:   r_   r`   rU   rb   ra   rc   rd   kwargs	deck_jsonfs              r   rV   Deck.to_html   sq    H LLN	
 00%-'%MM,==)77
 
  r?   c                 :    U R                  SS9n[        USS5      $ )NTrT   data )rV   getattr)r:   htmls     r   _repr_html_Deck._repr_html_   s#     ||T|2tVR((r?   )
r,   r-   r'   r(   r&   r"   r+   r8   r9   r%   rA   )NFNr   r    FF)__name__
__module____qualname____firstlineno__r	   r   r
   r   CARTOr7   r=   propertyrB   r5   r4   rW   rZ   rV   ro   __static_attributes__ r?   r   r   r      s     t45$a11E$**00^%@ . .

Ad 
A3
8 5n)r?   r   )rJ   sys
json_toolsr   layerr   io.htmlr   r   r.   viewr	   
view_stater
   base_map_providerr   
map_stylesr   r   r   modulesin_google_colabr   rx   r?   r   <module>r      sF    	 
 !  " 2  ! . 5 !CKK/R)9 R)r?   