a
    1$e                     @   s   d dl mZ d dlZd dlmZ d dlZd dlZd dl	m
Z
 g dZddddddddddddd	ddd
d
ddddi i i i i i i i fddZdd Zdd Zdddddd
d
ddi i i i fddZdS )    )meanN
LineString)Version)locationZprefer_canvasZno_touchZ
disable_3dZpng_enabledZzoom_controlcrs
zoom_startlefttoppositionmin_zoommax_zoomZmin_latZmax_latZmin_lonZmax_lonZ
max_boundsZOpenStreetMapTF   z100%c           N   	      s  df fdd	}zxddl } ddl}!ddl}"ddl}#ddlm}$ ddlm}% ddlm}& t	|#j
t	dk  rzddlm ndd	lm W n ttfy   td
Y n0 zddl}'d}(W n ttfy   d}(Y n0 |  | jdk})|) r
j|) dd j|)< jdu r$dd< d}njds<d|du rj}*dd}+|+du rt|*d |*d g},t|*d |*d g}-|-|,f}+d v rd}.nd}.nd}.tD ]0}/|/|v rtd|/ d|/ d||/  dqi |fdd D }|(rt|tr<z|'j !|}W n ty:   Y n0 t||'j"r|rT|n|j#}d|vrt|$dd|d< d|vr|$dd |d< |j%d!d"}|!j&f |+|||||d#|}|.r|'|*d |*d g|*d |*d gg tD ]}0|0d qd}1|durt(j)j*+|rJt,|j-d kr8td$nd%}2||2< |2}nrt| j.t(j/rv|durptd&d}
nFt(j)j*0| st(j)j*1| st(j)j*2| s|rd}
t(3| }1|
rt(j4| |1  |d'}3t,|3j5}4rnd(|% v rJt67|$j8d||4|3j9d)t67|$j8d||4t:|4d)}5nt|$j;rt67|$j8d|3j9t67|$j8dt:|4}5nZt(j)j*+r|4t,kr|4t, d  t6<|3j9t6<t:|4}5ntd*nt=rfd+d,| | D n|du r| > n|}|du r8| ? n|}|dur|du rTi }d-|vrf||d-< |&t6@| |1  |fi |}6t67|$j8d||6jA|6jBd)nPt6C||d.dd }7|&t6@| |1  d/|7d0}6t67|$j8d|d1|6jBd)d2vr
d3d2< d4vrdd4< d5v rLd5 	t=	s@td6d5 nd7d8 }8|8	dur6ttrttDjErjFv r	fd9d:}9|9}:nttDjGrtDjEd;|1dur|1 r|d<d};|;d=< jH|1 d=f< nd=< d<ds 	fd>d?}<|<}:n	fd@dA}=|=}:n	fdBdC}>|>}:|	rrd2vr`dDd2< fdEdF}?|?}@nd}@|du rdG}|}At|tr|dHkr|!jIf i |}An`|dIkr|!jJf i |}AnD|dGkr|$dJd|dJ< |$dKd|dK< |!jKf i |}AntdLttDjErFfdMd,jLdNkM D }BjN|BdOttDjErjOjPdurjQ tRdP|fi |}tRdQ|fi |}nd}d}jS}C|CdR D ]N}D|DdS D ]>}tT|DdS | tkr|"UdTdUd |DdS | |DdS |< qq|!jV|Cf|||A|:|@dVW| |r||d%k	s2|ndW}E|dX|E}E|
	r|3j5X }|5Y }5|1 	r|;	r|Z|dYdZ |5Z|; t[||E||5 n|dur||d[d}Fi }Gd\|v 	r|d\|Gd\< |
rt67|$j8d||6jAt:|6jAd)}H|F
r<|d]d
r|g|6j\Y  }Ind}I| j]j^|Hf|||E|Id^|G}Jn|d_d`}Kda|v 
r\|da }n*|6_|K}|dbd}L|L
sdcd, |D }|1 
r|;
r|Z|dYdZ t6Z|H|;}Ht[||E||H n~t| j]j`
rڈ}Jnh|}Mt67|$j8d|Mt:|Mja}H|Mjaddkr&| j]jb|Hf|||Ede|G}Jn| j]j^|Hf|||Ede|G}J|Fr||1 rr|;rrt[|dW|dYdZg|;g |c|J |S )gu&  Interactive map based on GeoPandas and folium/leaflet.js

    Generate an interactive leaflet map based on :class:`~geopandas.GeoDataFrame`

    Parameters
    ----------
    column : str, np.array, pd.Series (default None)
        The name of the dataframe column, :class:`numpy.array`,
        or :class:`pandas.Series` to be plotted. If :class:`numpy.array` or
        :class:`pandas.Series` are used then it must have same length as dataframe.
    cmap : str, matplotlib.Colormap, branca.colormap or function (default None)
        The name of a colormap recognized by ``matplotlib``, a list-like of colors,
        :class:`matplotlib.colors.Colormap`, a :class:`branca.colormap.ColorMap` or
        function that returns a named color or hex based on the column
        value, e.g.::

            def my_colormap(value):  # scalar value defined in 'column'
                if value > 1:
                    return "green"
                return "red"

    color : str, array-like (default None)
        Named color or a list-like of colors (named or hex).
    m : folium.Map (default None)
        Existing map instance on which to draw the plot.
    tiles : str, xyzservices.TileProvider (default 'OpenStreetMap Mapnik')
        Map tileset to use. Can choose from the list supported by folium, query a
        :class:`xyzservices.TileProvider` by a name from ``xyzservices.providers``,
        pass :class:`xyzservices.TileProvider` object or pass custom XYZ URL.
        The current list of built-in providers (when ``xyzservices`` is not available):

        ``["OpenStreetMap", "Stamen Terrain", “Stamen Toner", “Stamen Watercolor"
        "CartoDB positron", “CartoDB dark_matter"]``

        You can pass a custom tileset to Folium by passing a Leaflet-style URL
        to the tiles parameter: ``http://{s}.yourtiles.com/{z}/{x}/{y}.png``.
        Be sure to check their terms and conditions and to provide attribution with
        the ``attr`` keyword.
    attr : str (default None)
        Map tile attribution; only required if passing custom tile URL.
    tooltip : bool, str, int, list (default True)
        Display GeoDataFrame attributes when hovering over the object.
        ``True`` includes all columns. ``False`` removes tooltip. Pass string or list of
        strings to specify a column(s). Integer specifies first n columns to be
        included. Defaults to ``True``.
    popup : bool, str, int, list (default False)
        Input GeoDataFrame attributes for object displayed when clicking.
        ``True`` includes all columns. ``False`` removes popup. Pass string or list of
        strings to specify a column(s). Integer specifies first n columns to be
        included. Defaults to ``False``.
    highlight : bool (default True)
        Enable highlight functionality when hovering over a geometry.
    categorical : bool (default False)
        If ``False``, ``cmap`` will reflect numerical values of the
        column being plotted. For non-numerical columns, this
        will be set to True.
    legend : bool (default True)
        Plot a legend in choropleth plots.
        Ignored if no ``column`` is given.
    scheme : str (default None)
        Name of a choropleth classification scheme (requires ``mapclassify`` >= 2.4.0).
        A :func:`mapclassify.classify` will be used
        under the hood. Supported are all schemes provided by ``mapclassify`` (e.g.
        ``'BoxPlot'``, ``'EqualInterval'``, ``'FisherJenks'``, ``'FisherJenksSampled'``,
        ``'HeadTailBreaks'``, ``'JenksCaspall'``, ``'JenksCaspallForced'``,
        ``'JenksCaspallSampled'``, ``'MaxP'``, ``'MaximumBreaks'``,
        ``'NaturalBreaks'``, ``'Quantiles'``, ``'Percentiles'``, ``'StdMean'``,
        ``'UserDefined'``). Arguments can be passed in ``classification_kwds``.
    k : int (default 5)
        Number of classes
    vmin : None or float (default None)
        Minimum value of ``cmap``. If ``None``, the minimum data value
        in the column to be plotted is used.
    vmax : None or float (default None)
        Maximum value of ``cmap``. If ``None``, the maximum data value
        in the column to be plotted is used.
    width : pixel int or percentage string (default: '100%')
        Width of the folium :class:`~folium.folium.Map`. If the argument
        m is given explicitly, width is ignored.
    height : pixel int or percentage string (default: '100%')
        Height of the folium :class:`~folium.folium.Map`. If the argument
        m is given explicitly, height is ignored.
    categories : list-like
        Ordered list-like object of categories to be used for categorical plot.
    classification_kwds : dict (default None)
        Keyword arguments to pass to mapclassify
    control_scale : bool, (default True)
        Whether to add a control scale on the map.
    marker_type : str, folium.Circle, folium.CircleMarker, folium.Marker (default None)
        Allowed string options are ('marker', 'circle', 'circle_marker'). Defaults to
        folium.CircleMarker.
    marker_kwds: dict (default {})
        Additional keywords to be passed to the selected ``marker_type``, e.g.:

        radius : float (default 2 for ``circle_marker`` and 50 for ``circle``))
            Radius of the circle, in meters (for ``circle``) or pixels
            (for ``circle_marker``).
        fill : bool (default True)
            Whether to fill the ``circle`` or ``circle_marker`` with color.
        icon : folium.map.Icon
            the :class:`folium.map.Icon` object to use to render the marker.
        draggable : bool (default False)
            Set to True to be able to drag the marker around the map.

    style_kwds : dict (default {})
        Additional style to be passed to folium ``style_function``:

        stroke : bool (default True)
            Whether to draw stroke along the path. Set it to ``False`` to
            disable borders on polygons or circles.
        color : str
            Stroke color
        weight : int
            Stroke width in pixels
        opacity : float (default 1.0)
            Stroke opacity
        fill : boolean (default True)
            Whether to fill the path with color. Set it to ``False`` to
            disable filling on polygons or circles.
        fillColor : str
            Fill color. Defaults to the value of the color option
        fillOpacity : float (default 0.5)
            Fill opacity.
        style_function : callable
            Function mapping a GeoJson Feature to a style ``dict``.

            * Style properties :func:`folium.vector_layers.path_options`
            * GeoJson features :class:`GeoDataFrame.__geo_interface__`

            e.g.::

                lambda x: {"color":"red" if x["properties"]["gdp_md_est"]<10**6
                                             else "blue"}

        Plus all supported by :func:`folium.vector_layers.path_options`. See the
        documentation of :class:`folium.features.GeoJson` for details.

    highlight_kwds : dict (default {})
        Style to be passed to folium highlight_function. Uses the same keywords
        as ``style_kwds``. When empty, defaults to ``{"fillOpacity": 0.75}``.
    tooltip_kwds : dict (default {})
        Additional keywords to be passed to :class:`folium.features.GeoJsonTooltip`,
        e.g. ``aliases``, ``labels``, or ``sticky``.
    popup_kwds : dict (default {})
        Additional keywords to be passed to :class:`folium.features.GeoJsonPopup`,
        e.g. ``aliases`` or ``labels``.
    legend_kwds : dict (default {})
        Additional keywords to be passed to the legend.

        Currently supported customisation:

        caption : string
            Custom caption of the legend. Defaults to the column name.

        Additional accepted keywords when ``scheme`` is specified:

        colorbar : bool (default True)
            An option to control the style of the legend. If True, continuous
            colorbar will be used. If False, categorical legend will be used for bins.
        scale : bool (default True)
            Scale bins along the colorbar axis according to the bin edges (True)
            or use the equal length for each bin (False)
        fmt : string (default "{:.2f}")
            A formatting specification for the bin edges of the classes in the
            legend. For example, to have no decimals: ``{"fmt": "{:.0f}"}``. Applies
            if ``colorbar=False``.
        labels : list-like
            A list of legend labels to override the auto-generated labels.
            Needs to have the same number of elements as the number of
            classes (`k`). Applies if ``colorbar=False``.
        interval : boolean (default False)
            An option to control brackets from mapclassify legend.
            If True, open/closed interval brackets are shown in the legend.
            Applies if ``colorbar=False``.
        max_labels : int, default 10
            Maximum number of colorbar tick labels (requires branca>=0.5.0)
    map_kwds : dict (default {})
        Additional keywords to be passed to folium :class:`~folium.folium.Map`,
        e.g. ``dragging``, or ``scrollWheelZoom``.


    **kwargs : dict
        Additional options to be passed on to the folium object.

    Returns
    -------
    m : folium.folium.Map
        folium :class:`~folium.folium.Map` instance

    Examples
    --------
    >>> import geodatasets
    >>> df = geopandas.read_file(
    ...     geodatasets.get_path("geoda.chicago_health")
    ... )
    >>> df.head(2)  # doctest: +SKIP
       ComAreaID  ...                                           geometry
    0         35  ...  POLYGON ((-87.60914 41.84469, -87.60915 41.844...
    1         36  ...  POLYGON ((-87.59215 41.81693, -87.59231 41.816...

    [2 rows x 87 columns]

    >>> df.explore("Pop2012", cmap="Blues")  # doctest: +SKIP
    Nc                    s:   |s | S  r& | ||S  | ||S dS )z$Helper for MPL deprecation - GH#2596N)Zget_cmapZ	resampled)Z_cmap
n_resampleidx)MPL_361cm M/var/www/html/django/DPS/env/lib/python3.9/site-packages/geopandas/explore.py_colormap_helper  s
    
z"_explore.<locals>._colormap_helperr   )colors)classifyz3.6.1)	colormaps)r   zThe 'folium', 'matplotlib' and 'mapclassify' packages are required for 'explore()'. You can install them using 'conda install -c conda-forge folium matplotlib mapclassify' or 'pip install folium matplotlib mapclassify'.TFZ
LinearRingc                 S   s   t | S Nr   )gr   r   r   <lambda>>      z_explore.<locals>.<lambda>ZSimpler   i  r            r   'z.' cannot be specified in 'map_kwds'. Use the '=z' argument instead.c                    s   i | ]}|t v r| | qS r   )_MAP_KWARGS).0i)kwargsr   r   
<dictcomp>`  r   z_explore.<locals>.<dictcomp>r   r      z{r})Zscale_factor)r   control_scaletilesattrwidthheightz@The GeoDataFrame and given column have different number of rows.__plottable_columnz=Cannot specify 'categories' when column has categorical dtype)
categoriesZtab20)r   r   zo'cmap' is invalid. For categorical plots, pass either valid named matplotlib colormap or a list-like of colors.c                    s   g | ]} |qS r   r   )r#   x)cmapr   r   
<listcomp>  r   z_explore.<locals>.<listcomp>ki  ZUserDefined)bins   ZfillOpacityg      ?weightstyle_functionz%'style_function' has to be a callablec                 S   s   i S r   r   r/   r   r   r   	_no_style  s    z_explore.<locals>._no_stylec                    s$   d| d   i}i || S )N	fillColor
propertiesr   r/   
base_style)color
style_kwdsstyle_kwds_functionr   r   _style_color  s    z_explore.<locals>._style_color)geometryr=   __folium_colorc                    s.   | d d | d d d }i || S Nr:   rB   )r9   r=   r   r;   r>   r?   r   r   _style_column  s    

z_explore.<locals>._style_columnc                    s&   | d d  d}i || S rC   r   r;   )stroke_colorr>   r?   r   r   _style_stroke'  s    
z_explore.<locals>._style_strokec                    s   i  | S r   r   r7   rD   r   r   _style_default5  s    z _explore.<locals>._style_defaultg      ?c                    s   i  S r   r   r7   )highlight_kwdsr   r   _style_highlight>  s    z"_explore.<locals>._style_highlightZcircle_markermarkercircleZradiusfillzKOnly 'marker', 'circle', and 'circle_marker' are supported as marker valuesc                    s$   g | ]\}}|r| j jkr|qS r   )rA   name)r#   rN   val)gdfr   r   r1   [  s   rA   )columnstooltippopupfeaturesr:   z\{{2,}c                 S   s   d|  d d S )Nz	{% raw %}r   z{% endraw %})groupr7   r   r   r   r   u  r   )rR   rS   rK   r6   highlight_function captionlabelNaNcolorbarZ
max_labelsscale)vminvmaxrX   indexfmtz{:.2f}labelsintervalc                 S   s   g | ]}|d d qS )r   r   )r#   cr   r   r   r1     r      )r]   r^   rX   )NN)dbrancafoliumre
matplotlibr   Zmatplotlib.pyplotZpyplotZmapclassifyr   r   __version__r   r   ImportErrorModuleNotFoundErrorxyzservicescopyZ	geom_typeanyrA   applyr   equalsZto_crsZtotal_boundspopr   keysr"   
ValueError
isinstancestr	providersZ
query_nameZTileProviderZhtml_attributiongetZ	build_urlZMapZ
fit_boundspdapitypesZis_list_likelenshapeZdtypeZCategoricalDtypeZis_object_dtypeZis_bool_dtypeZis_string_dtypeZisnaZCategoricalr.   npZapply_along_axisZto_hexcodesrangeZColormaptakecallableminmaxZasarrayr2   ZybZlinspace	geopandasZGeoDataFramerQ   Z	GeoSerieslocMarkerZCircleZCircleMarkerZdtypesitemsdropr_   rN   Zreset_index_tooltip_popupZ__geo_interface__typesubZGeoJsonZadd_toto_listtolistappend_categorical_legendr3   ZcolormapZStepColormapZget_legend_classesZColorMapNZLinearColormap	add_child)Ndfcolumnr0   r=   mr)   r*   rR   rS   	highlightZcategoricallegendschemer2   r]   r^   r+   r,   r.   Zclassification_kwdsr(   marker_typemarker_kwdsr>   rI   Zmissing_kwdsZtooltip_kwdsZ
popup_kwdsZlegend_kwdsmap_kwdsr%   r   bcrg   rh   ri   r   Zpltr   rm   ZHAS_XYZSERVICESZ
rings_maskZboundsr   r/   yfitr$   Zmap_kwdZnan_idxZcolumn_namecatr   Zlegend_colorsZbinningr3   r8   r@   r6   Z	nan_colorrE   rG   rH   rJ   rV   rK   Znon_active_geomsZfeature_collectionfeaturerX   ZcbarZcolormap_kwdsZ	cb_colorsr_   r[   r`   Zshow_intervalZmp_cmapr   )
r   r   r0   r=   rP   rI   r%   rF   r>   r?   r   _explore    s    o












&

























	




r   c                 K   s   ddl }|du s |du s |dkr$dS |du rB|j|jj }n8t|trj|j|jj d| }nt|trz|g}dD ]}||v r~|	| q~t
tt|}| dkr|j|fi |S | dkr|j|fi |S dS )zget tooltip or popupr   NFT)r-   rB   rR   rS   )rg   rQ   r   rA   rN   r   ru   intrv   removelistmapZGeoJsonTooltipZGeoJsonPopup)r   fieldsrP   kwdsrg   fieldr   r   r   r     s"    

r   c           
      C   s   d}ddl }|j }|j||_|  | d| d| d}t||D ]\}}	|d|	 d| d	7 }qN|d
7 }|j|d}|  j	| dS )a?  
    Add categorical legend to a map

    The implementation is using the code originally written by Michel Metran
    (@michelmetran) and released on GitHub
    (https://github.com/michelmetran/package_folium) under MIT license.

    Copyright (c) 2020 Michel Metran

    Parameters
    ----------
    m : folium.Map
        Existing map instance on which to draw the plot
    title : str
        title of the legend (e.g. column name)
    categories : list-like
        list of categories
    colors : list-like
        list of colors (in the same order as categories)
    aI  
    {% macro header(this, kwargs) %}
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <script>$( function() {
        $( ".maplegend" ).draggable({
            start: function (event, ui) {
                $(this).css({
                    right: "auto",
                    top: "auto",
                    bottom: "auto"
                });
            }
        });
    });
    </script>
    <style type='text/css'>
      .maplegend {
        position: absolute;
        z-index:9999;
        background-color: rgba(255, 255, 255, .8);
        border-radius: 5px;
        box-shadow: 0 0 15px rgba(0,0,0,0.2);
        padding: 10px;
        font: 12px/14px Arial, Helvetica, sans-serif;
        right: 10px;
        bottom: 20px;
      }
      .maplegend .legend-title {
        text-align: left;
        margin-bottom: 5px;
        font-weight: bold;
        }
      .maplegend .legend-scale ul {
        margin: 0;
        margin-bottom: 0px;
        padding: 0;
        float: left;
        list-style: none;
        }
      .maplegend .legend-scale ul li {
        list-style: none;
        margin-left: 0;
        line-height: 16px;
        margin-bottom: 2px;
        }
      .maplegend ul.legend-labels li span {
        display: block;
        float: left;
        height: 14px;
        width: 14px;
        margin-right: 5px;
        margin-left: 0;
        border: 0px solid #ccc;
        }
      .maplegend .legend-source {
        color: #777;
        clear: both;
        }
      .maplegend a {
        color: #777;
        }
    </style>
    {% endmacro %}
    r   Nz
    <div id='maplegend z7' class='maplegend'>
        <div class='legend-title'>zP</div>
        <div class='legend-scale'>
            <ul class='legend-labels'>z-
                <li><span style='background:z	'></span>z</li>z1
            </ul>
        </div>
    </div>
    r   )
rf   elementZMacroElementTemplate	_templateZget_rootr   zipZElementhtml)
r   titler.   r   headr   macrobodyrY   r=   r   r   r   r     s&    @
r   c                 K   s,   t | f|||||||||	|
|||d|S )u  Interactive map based on GeoPandas and folium/leaflet.js

    Generate an interactive leaflet map based on :class:`~geopandas.GeoSeries`

    Parameters
    ----------
    color : str, array-like (default None)
        Named color or a list-like of colors (named or hex).
    m : folium.Map (default None)
        Existing map instance on which to draw the plot.
    tiles : str, xyzservices.TileProvider (default 'OpenStreetMap Mapnik')
        Map tileset to use. Can choose from the list supported by folium, query a
        :class:`xyzservices.TileProvider` by a name from ``xyzservices.providers``,
        pass :class:`xyzservices.TileProvider` object or pass custom XYZ URL.
        The current list of built-in providers (when ``xyzservices`` is not available):

        ``["OpenStreetMap", "Stamen Terrain", “Stamen Toner", “Stamen Watercolor"
        "CartoDB positron", “CartoDB dark_matter"]``

        You can pass a custom tileset to Folium by passing a Leaflet-style URL
        to the tiles parameter: ``http://{s}.yourtiles.com/{z}/{x}/{y}.png``.
        Be sure to check their terms and conditions and to provide attribution with
        the ``attr`` keyword.
    attr : str (default None)
        Map tile attribution; only required if passing custom tile URL.
    highlight : bool (default True)
        Enable highlight functionality when hovering over a geometry.
    width : pixel int or percentage string (default: '100%')
        Width of the folium :class:`~folium.folium.Map`. If the argument
        m is given explicitly, width is ignored.
    height : pixel int or percentage string (default: '100%')
        Height of the folium :class:`~folium.folium.Map`. If the argument
        m is given explicitly, height is ignored.
    control_scale : bool, (default True)
        Whether to add a control scale on the map.
    marker_type : str, folium.Circle, folium.CircleMarker, folium.Marker (default None)
        Allowed string options are ('marker', 'circle', 'circle_marker'). Defaults to
        folium.Marker.
    marker_kwds: dict (default {})
        Additional keywords to be passed to the selected ``marker_type``, e.g.:

        radius : float
            Radius of the circle, in meters (for ``'circle'``) or pixels
            (for ``circle_marker``).
        icon : folium.map.Icon
            the :class:`folium.map.Icon` object to use to render the marker.
        draggable : bool (default False)
            Set to True to be able to drag the marker around the map.

    style_kwds : dict (default {})
        Additional style to be passed to folium ``style_function``:

        stroke : bool (default True)
            Whether to draw stroke along the path. Set it to ``False`` to
            disable borders on polygons or circles.
        color : str
            Stroke color
        weight : int
            Stroke width in pixels
        opacity : float (default 1.0)
            Stroke opacity
        fill : boolean (default True)
            Whether to fill the path with color. Set it to ``False`` to
            disable filling on polygons or circles.
        fillColor : str
            Fill color. Defaults to the value of the color option
        fillOpacity : float (default 0.5)
            Fill opacity.
        style_function : callable
            Function mapping a GeoJson Feature to a style ``dict``.

            * Style properties :func:`folium.vector_layers.path_options`
            * GeoJson features :class:`GeoSeries.__geo_interface__`

            e.g.::

                lambda x: {"color":"red" if x["properties"]["gdp_md_est"]<10**6
                                             else "blue"}


        Plus all supported by :func:`folium.vector_layers.path_options`. See the
        documentation of :class:`folium.features.GeoJson` for details.

    highlight_kwds : dict (default {})
        Style to be passed to folium highlight_function. Uses the same keywords
        as ``style_kwds``. When empty, defaults to ``{"fillOpacity": 0.75}``.
    map_kwds : dict (default {})
        Additional keywords to be passed to folium :class:`~folium.folium.Map`,
        e.g. ``dragging``, or ``scrollWheelZoom``.

    **kwargs : dict
        Additional options to be passed on to the folium.

    Returns
    -------
    m : folium.folium.Map
        folium :class:`~folium.folium.Map` instance

    )r=   r   r)   r*   r   r+   r,   r(   r   r   r>   rI   r   )r   )sr=   r   r)   r*   r   r+   r,   r(   r   r   r>   rI   r   r%   r   r   r   _explore_geoseriesn  s&    tr   )
statisticsr   r   Zshapely.geometryr   numpyr~   Zpandasry   Zpackaging.versionr   r"   r   r   r   r   r   r   r   r   <module>   sr   
     Dv