
    ag;                    N   d dl Z d dlZd dlmZ d dlZd dlZd dlZd dl	Z
d dlZd dlmZ d dlmZ d dl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 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/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8 d dl9m:Z:m;Z; d dl<m=Z= d dl>m?Z?m@Z@ d dlAmBZBmCZC d dlDmEZEmFZF d dlmGZGmHZH ddlImJZJ ddlKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZcmdZdmeZemfZf ddlgmhZh  ej                  d      Zi G d de      Zj G d d      Zky)    N)partial)	HoverTool)	Dimension)
DynamicMapHoloMapCallable)	NdOverlay)StoreCyclePalette)NdLayout)	max_range)CurveScatterAreaBars
BoxWhiskerDatasetDistributionTableHeatMapImageHexTilesQuadMesh	Bivariate	HistogramViolinContoursPolygonsPointsPathLabelsRGB	ErrorBarsVectorField
RectanglesSegments)OverlayPlotcolormap_generator)process_cmap)	histogram
apply_when)BufferPipe)dimlon_lat_to_easting_northing)DatetimeIndex
MultiIndex   )_transfer_opts_cur_backend)filter_opts
is_tabular	is_seriesis_dask	is_duckdb	is_intakeis_cudf
is_streamzis_ibisis_lazy_data	is_xarrayis_xarray_dataarrayprocess_crsprocess_intakeprocess_xarrayrelabelrelabel_redimredim_support_indexcheck_libraryis_geodataframeprocess_derived_datetime_xarrayprocess_derived_datetime_pandas_convert_col_names_to_strimport_datashaderimport_geoviewsis_mpl_cmap)hvplot_extensionbokehc                   F    e Zd ZdZ ej
                         ZddZd Zd Z	y)StreamingCallablezy
    StreamingCallable is a DynamicMap callback wrapper which keeps
    a handle to start and stop a dynamic stream.
    Nc                     | j                   j                         D ci c]  \  }}|dvs|| }}}t        |fi |}|| j                  n|} | j                  |fi |S c c}}w )zw
        Allows making a copy of the Callable optionally overriding
        the callable and other parameters.
        )callablename)paramget_param_valuesdictrU   	__class__)selfrU   	overrideskvoldparamss          0lib/python3.12/site-packages/hvplot/converter.pyclonezStreamingCallable.clone_   sr    
 !%

 ; ; =_ =1J^A^q!t =_c'Y'$,$44==(t~~h1&11 `s
   A"A"c                 z    | j                   j                  s| j                   j                          yt        d      )z-
        Start the periodic callback
        z!PeriodicCallback already running.N)periodic_runningstart	Exceptionr[   s    ra   rf   zStreamingCallable.starti   s-     }}%%MM!?@@    c                 z    | j                   j                  r| j                   j                          yt        d      )z,
        Stop the periodic callback
        zPeriodicCallback not running.N)rd   re   stoprg   rh   s    ra   rk   zStreamingCallable.stopr   s-     ==!!MM ;<<ri   N)
__name__
__module____qualname____doc__rW   	Parameterrd   rb   rf   rk    ri   ra   rS   rS   W   s'    
 u H2A=ri   rS   c            D       T   e Zd ZdZg dZddgZ eeez   g dz         Zg dZg dZ	g dZ
g d	Zg d
Zg dZi ddgdddgdg ddg ddg dddgdg ddg ddg dddd gd!g d"d#g d$d%g d&d'g d(dd d)gd*dd+gd,g d-d.gdgdd gd/d0gd1Zi ded2ed3eded4edededed5edededed!ed#ed6ed,edeeee e!ee"e#ee$e%e&d7Z'g d8Z(d9Z)d:d:d;d<d:d:d;d=Z*d>e+jX                  d?   d@dAdBZ-dCdCd;dCdDdEd:d:dCi dCd;dCdCdCdCdCdCdCdCdCdCdCdCdCg dCdCd:dCd:d:dCdCd:d:dCdCdCdCd:d;dCdCdCd:d:dCdCd:dCdCdCd:g dCd:d:dCd;dFi dCdCdCdCdCdCfDdGZ.dH Z/dI Z0dJ Z1dK Z2dL Z3dM Z4dN Z5dO Z6dP Z7ddQZ8dR Z9ddSZ:ddTZ;dU Z<e=dV        Z>dW Z?dX Z@dY ZAddZZBdd[ZCdd\ZDd] ZEdd^ZFd_ ZGdd`ZHddaZIddbZJddcZKdddZLddeZMdfeNdgeOeN   fdhZPddiZQddjZRddkZSddlZTddmZUddnZVddoZWddpZXddqZYddrZZddsZ[ddtZ\dduZ]ddvZ^ddwZ_dx Z`dy ZaddzZbdd{Zcdd|Zddd}Zedd~ZfddZgddZhddZiddZjddZkyC)HoloViewsConvertera]-  
    Generic options
    ---------------
    autorange (default=None): Literal['x', 'y'] | None
        Whether to enable auto-ranging along the x- or y-axis when
        zooming. Requires HoloViews >= 1.16.
    bgcolor (default=None): str
        Background color of the data area of the plot
    clim: tuple
        Lower and upper bound of the color scale
    cnorm (default='linear'): str
        Color scaling which must be one of 'linear', 'log' or 'eq_hist'
    colorbar (default=False): boolean
        Enables a colorbar
    fontscale: number
        Scales the size of all fonts by the same amount, e.g. fontscale=1.5
        enlarges all fonts (title, xticks, labels etc.) by 50%
    fontsize: number or dict
        Set title, label and legend text to the same fontsize. Finer control
        by using a dict: {'title': '15pt', 'ylabel': '5px', 'ticks': 20}
    flip_xaxis/flip_yaxis: boolean
        Whether to flip the axis left to right or up and down respectively
    grid (default=False): boolean
        Whether to show a grid
    hover : boolean
        Whether to show hover tooltips, default is True unless datashade is
        True in which case hover is False by default
    hover_cols (default=[]): list or str
        Additional columns to add to the hover tool or 'all' which will
        includes all columns (including indexes if use_index is True).
    hover_formatters:
        A dict of formatting options for the hover tooltip.
    hover_tooltips list[str] or list[tuple]:
        A list of dimensions to be displayed in the hover tooltip.
    invert (default=False): boolean
        Swaps x- and y-axis
    frame_width/frame_height: int
        The width and height of the data area of the plot
    legend (default=True): boolean or str
        Whether to show a legend, or a legend position
        ('top', 'bottom', 'left', 'right')
    logx/logy (default=False): boolean
        Enables logarithmic x- and y-axis respectively
    logz (default=False): boolean
        Enables logarithmic colormapping
    loglog (default=False): boolean
        Enables logarithmic x- and y-axis
    max_width/max_height: int
        The maximum width and height of the plot for responsive modes
    min_width/min_height: int
        The minimum width and height of the plot for responsive modes
    padding: number or tuple
        Fraction by which to increase auto-ranged extents to make
        datapoints more visible around borders. Supports tuples to
        specify different amount of padding for x- and y-axis and
        tuples of tuples to specify different amounts of padding for
        upper and lower bounds.
    rescale_discrete_levels (default=True): boolean
        If `cnorm='eq_hist'` and there are only a few discrete values,
        then `rescale_discrete_levels=True` (the default) decreases
        the lower limit of the autoranged span so that the values are
        rendering towards the (more visible) top of the `cmap` range,
        thus avoiding washout of the lower values.  Has no effect if
        `cnorm!=`eq_hist`.
    responsive: boolean
        Whether the plot should responsively resize depending on the
        size of the browser. Responsive mode will only work if at
        least one dimension of the plot is left undefined, e.g. when
        width and height or width and aspect are set the plot is set
        to a fixed size, ignoring any responsive option.
    robust: bool
        If True and clim are absent, the colormap range is computed
        with 2nd and 98th percentiles instead of the extreme values
        for image elements. For RGB elements, clips the "RGB", or
        raw reflectance values between 2nd and 98th percentiles.
        Follows the same logic as xarray's robust option.
    rot: number
        Rotates the axis ticks along the x-axis by the specified
        number of degrees.
    subcoordinate_y: bool or dict
       Whether to enable sub-coordinate y systems for this plot. Accepts also a
       dictionary of related options to pass down to HoloViews,
       e.g. `{'subcoordinate_scale': 2}`.
    shared_axes (default=True): boolean
        Whether to link axes between plots
    transforms (default={}): dict
        A dictionary of HoloViews dim transforms to apply before plotting
    title (default=''): str
        Title for the plot
    tools (default=[]): list
        List of tool instances or strings (e.g. ['tap', 'box_select'])
    xaxis/yaxis: str or None
        Whether to show the x/y-axis and whether to place it at the
        'top'/'bottom' and 'left'/'right' respectively.
    xformatter/yformatter (default=None): str or TickFormatter
        Formatter for the x-axis and y-axis (accepts printf formatter,
        e.g. '%.3f', and bokeh TickFormatter)
    xlabel/ylabel/clabel (default=None): str
        Axis labels for the x-axis, y-axis, and colorbar
    xlim/ylim (default=None): tuple or list
        Plot limits of the x- and y-axis
    xticks/yticks/cticks (default=None): int or list
        Ticks along x-axis, y-axis, and colorbar specified as an integer, list of
        ticks positions, or list of tuples of the tick positions and labels
    width (default=700)/height (default=300): int
        The width and height of the plot in pixels
    attr_labels (default=None): bool
        Whether to use an xarray object's attributes as labels, defaults to
        None to allow best effort without throwing a warning. Set to True
        to see warning if the attrs can't be found, set to False to disable
        the behavior.
    sort_date (default=True): bool
        Whether to sort the x-axis by date before plotting
    symmetric (default=None): bool
        Whether the data are symmetric around zero. If left unset, the data
        will be checked for symmetry as long as the size is less than
        ``check_symmetric_max``.
    check_symmetric_max (default=1000000):
        Size above which to stop checking for symmetry by default on the data.

    Resampling options
    ------------------
    aggregator (default=None):
        Aggregator to use when applying rasterize or datashade operation
        (valid options include 'mean', 'count', 'min', 'max' and more, and
        datashader reduction objects)
    dynamic (default=True):
        Whether to return a dynamic plot which sends updates on widget and
        zoom/pan events or whether all the data should be embedded
        (warning: for large groupby operations embedded data can become
        very large if dynamic=False)
    datashade (default=False):
        Whether to apply rasterization and shading (colormapping) using
        the Datashader library, returning an RGB object instead of
        individual points
    downsample (default=False):
        Controls the application of downsampling to the plotted data,
        which is particularly useful for large timeseries datasets to
        reduce the amount of data sent to browser and improve
        visualization performance. Requires HoloViews >= 1.16. Additional
        dependencies: Installing the `tsdownsample` library is required
        for using any downsampling methods other than the default 'lttb'.
        Acceptable values:
        - False: No downsampling is applied.
        - True: Applies downsampling using HoloViews' default algorithm
            (LTTB - Largest Triangle Three Buckets).
        - 'lttb': Explicitly applies the Largest Triangle Three Buckets
          algorithm.
        - 'minmax': Applies the MinMax algorithm, selecting the minimum
          and maximum values in each bin. Requires `tsdownsample`.
        - 'm4': Applies the M4 algorithm, selecting the minimum, maximum,
          first, and last values in each bin. Requires `tsdownsample`.
        - 'minmax-lttb': Combines MinMax and LTTB algorithms for
          downsampling, first applying MinMax to reduce to a preliminary
          set of points, then LTTB for further reduction. Requires
          `tsdownsample`.
        Other string values corresponding to supported algorithms in
        HoloViews may also be used.
    dynspread (default=False):
        For plots generated with datashade=True or rasterize=True,
        automatically increase the point size when the data is sparse
        so that individual points become more visible
    pixel_ratio (default=None):
       Pixel ratio applied to the height and width, used when rasterizing or
       datashading. When not set explicitly, the ratio is automatically
       obtained from the browser device pixel ratio. Default is 1 when
       the browser information is not available. Useful when the browser
       information is not available (pixel_ratio=2 can give better results on
       Retina displays) or for using lower resolution for speed.
    rasterize (default=False):
        Whether to apply rasterization using the Datashader library,
        returning an aggregated Image (to be colormapped by the
        plotting backend) instead of individual points
    resample_when (default=None):
        Applies a resampling operation (datashade, rasterize or downsample) if
        the number of individual data points present in the current zoom range
        is above this threshold. The raw plot is displayed otherwise.
    x_sampling/y_sampling (default=None):
        Specifies the smallest allowed sampling interval along the x/y axis.
        Used when rasterizing or datashading.

    Geographic options
    ------------------
    coastline (default=False):
        Whether to display a coastline on top of the plot, setting
        coastline='10m'/'50m'/'110m' specifies a specific scale.
    crs (default=None):
        Coordinate reference system of the data (input projection) specified as a string
        or integer EPSG code, a CRS or Proj pyproj object, a Cartopy
        CRS object or class name, a WKT string, or a proj.4 string.
        Defaults to PlateCarree.
    features (default=None): dict or list
        A list of features or a dictionary of features and the scale
        at which to render it. Available features include 'borders',
        'coastline', 'lakes', 'land', 'ocean', 'rivers' and 'states'.
        Available scales include '10m'/'50m'/'110m'.
    geo (default=False):
        Whether the plot should be treated as geographic (and assume
        PlateCarree, i.e. lat/lon coordinates).
    global_extent (default=False):
        Whether to expand the plot extent to span the whole globe.
    project (default=False):
        Whether to project the data before plotting (adds initial
        overhead but avoids projecting data when plot is dynamically
        updated).
    projection (default=None): str or Cartopy CRS
        Coordinate reference system of the plot (output projection) specified as a string
        or integer EPSG code, a CRS or Proj pyproj object, a Cartopy
        CRS object or class name, a WKT string, or a proj.4 string.
        Defaults to PlateCarree.
    tiles (default=False):
        Whether to overlay the plot on a tile source. If coordinate values fall within
        lat/lon bounds, auto-projects to EPSG:3857, unless `projection=False`.
        - `True`: OpenStreetMap layer
        - `xyzservices.TileProvider` instance (requires xyzservices to
           be installed)
        - a map string name based on one of the default layers made
          available by HoloViews or GeoViews.
        - a `holoviews.Tiles` or `geoviews.WMTS` instance or class
    tiles_opts (default=None): dict
        Options to customize the tiles layer created when `tiles` is set,
        e.g. `dict(alpha=0.5)`.
    )imagecontourcontourfquadmeshrgbpointsdatasetpathspolygons)rz   vectorfieldlabelshexbin	bivariate)histkdeviolinboxdensity)xykindby	use_indexuse_daskdynamiccrsvalue_labelgroup_labelbacklogpersist	sort_date)geor   featuresproject	coastlinetiles
projectionglobal_extents)$widthheightshared_axesgridlegendrotxlimylimxticksytickscolorbarinverttitlelogxlogyloglogxaxisyaxis
xformatter
yformatterxlabelylabelclabelpadding
responsive
max_height	max_width
min_height	min_widthframe_heightframe_widthaspectdata_aspect	fontscalebgcolorsubcoordinate_y)
coloralphacolormapfontsizecctickscmap	color_keycnormrescale_discrete_levels)	datashade	rasterizepixel_ratio
x_sampling
y_sampling
downsample
aggregatorresample_whenareay2	errorbarsyerr1yerr2r   )	bandwidthcutfilledlevelsrv   )zr   logzrw   r{   columnsheatmap)Creduce_functionr   r   )r   r   gridsizer   	min_countr   )bins	bin_rangenormed
cumulativeru   r   r   r   )	bw_methodindr   r   r   r   )textr   xoffsetyoffset	text_fonttext_font_sizeohlc)	bar_width	pos_color	neg_color
line_colorrz   )smarkerr   scaler   r   ry   bandsscatter)r   r   r   r   r   whereanglemag)steptablerx   r~   barbarhr   r   line)r   r   r|   rz   r}   rx   ry   r   r   r~   r   )r   rv   rw   r   ru   r   rx   r}   )	top_righttop_leftbottom_leftbottom_rightrightlefttopbottomFTr  )r   r   show_legendlegend_position	show_gridr   r   kbc_rglasbey_category10
colorwheelcoolwarm)linearcategoricalcyclic	divergingNvaluei  i@B cH                   \ || _         || _        || _        |!| _        | j	                  |||||||*|+||
|	|!||||;AB|H       || _        t        |1||0|/|9|<Dg      | _        | j                  s| j                  dk(  r
t                | j                  r| j                  ||      nd | _        | j                  | _        |9| _        |<| _        D| _        |=| _        |>xs i | _        |?| _        | j                  rA| j&                  | j(                  vrCt*        j,                  j*                  j/                  d| j&                  d| j(                         ddlm}I ddlm}J |/t7        |/      }/|/xs |=rIj8                  n| j                  | _        |=r$| j                  Ij8                  k7  rt;        d      | j                  |/k7  r|s|r|Ij8                  j<                  j>                  \  }K}L}M}N|xs KMf\  }O}P|xs LNf\  }Q}RO|QP|Rf}S J|S| j                  | j                        \  }O}Q}P}R|rOPf}|rQRf}n|/du r|/| _        |)t        |'|&|(g      st;        d	      |)| _         |&| _!        |'| _"        |(| _#        |5| _$        |.| _%        |2| _&        |6| _'        |7| _(        |8| _)        | | _*        | rtV        ntX        | _-        t\        j^                  | _0        tb        jd                  | j`                  | _3        ntb        jd                  | _3        |#| _4        tk        | jl                  fi | jo                         \|tq        |      \d
<   |tq        |      \d<   FF\d<   |"| _9        ||xs |}|xs |}||\d<   ||\d<   ||\d<   |tu        |      \d<   || jv                  v r|\d<   n&|dvr"t;        dty        | jv                         d      Gr&d\d<   t{        Gtj              r\j}                  G       g d}T|TD ]  }U|UHv sHj                  U      \|U<    | j                  H\      \  | _A        \}HdD ]?  }V|VHv sHj                  V      }W|Wsd \V<   !WsW\V<   )V\v s.\j                  Vd        A |3rd\d<   |4rd\d<   | j                  r\j                  d      sd\d<   g d}Xt        \fd|XD              s*\j                  dd       \d<   \j                  d!d"      \d!<   t{        |$tt              r|$\d#<   n?| j&                  | j                  v rd\d#<   n!| jD                  r\j                  d#d      \d#<   \j                  d#      du r>|%<| j`                  d$k(  rt;        d%      | j`                  d&k(  rd'nd(}Y|%| j                  |Y<   d)Hv r<d)| j                  j                  | j&                  i       v rHj                  d)      \d)<   |"r| j&                  d*k7  \d+<   |r|"rd,nd-}W|\|W<   ty        |:      xs ty        \j                  d.g             }:|d/k(  rd}n|| jB                   }|r,t        d0 |:D              s|d1v r|\d2<   |:j                  d3       d3|:v r|r|\d4<   |r|\d5<   |:\d.<   | j                  r|0r|0\d6<   |/r| j                  \d7<   ||nt        | d8d       }||\d9<   | j&                  | j                  v s$| jD                  s| jB                  s| j                  r	 |s| j                  ||@      }| j                  j                  d:      k| j                         d   r| j                  d;   | j                  d:<   n;|r| j                  d<   | j                  d:<   n| j                  d=   | j                  d:<   |rd\d><   ||\d?<   CC\d@<   EE\dA<   \| _L        | j                  j                         D Z[ci c])  \  }Z}[|Zt        j*                  j                         v s'Z[+ c}[}Z| _P        |-\j                  dB       dC| _Q        H| _R        |!| _        |!rdD|!ini | _S        dE|xs dFi| _T        | j                  H       |,rtk        | j                  | j                  | j                  | j&                  | j                  | j                  G      }Ht*        j,                  j*                  j/                   dHj                  dIi |H       y y # t        $ r Y Rw xY wc c}[}Zw )JN	geopandasz$geo option cannot be used with kind=zJ plot type. Geographic plots are only supported for following plot types: r   )r   )project_extentszTiles can only be used with output projection of `cartopy.crs.GOOGLE_MERCATOR`. To get rid of this error remove `projection=` or `tiles=`FzpAt least one resampling operation (rasterize, datashader, downsample) must be enabled when resample_when is set.r   r   	autoranger   r   r	  r  r  )TFNzNThe legend option should be a boolean or a valid legend position (i.e. one of z).Tr   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   invert_xaxisinvert_yaxisr   r3   )r   r   r   r   r   c              3   @   K   | ]  }j                  |        y wrl   )get).0opt	plot_optss     ra   	<genexpr>z.HoloViewsConverter.__init__.<locals>.<genexpr>,  s     =#9==%   r   i  r   i,  r   plotlyz1cticks option is not supported for plotly backendrQ   r   
cbar_ticksr   r   invert_axes	yrotation	xrotationtoolsr   c              3   J   K   | ]  }t        |t              s|d v s|  yw))hovervlinehlineN)
isinstancer   )r  ts     ra   r  z.HoloViewsConverter.__init__.<locals>.<genexpr>J  s%      
!
1i 8AA\<\Aus   ##>   r)  r(  
hover_moder'  hover_tooltipshover_formattersglobal_extentr   _titler   r   r  r  r  clim_percentile	symmetricr   r   r   )	framewiseaxiswiselabelr   NN)r   r   r   r   groupbyr   zbPlotting {kind} plot with parameters x: {x}, y: {y}, by: {by}, groupby: {groupby}, row/col: {grid}rr   )\_redimr   r   r5  _process_datar   anyr   datatyperN   _process_crsr   output_projectionr   r   r   r   
tiles_optsr   r   
_geo_typesrW   mainwarningcartopygeoviews.utilr  rA   GOOGLE_MERCATOR
ValueErrorboundaryboundsr   r   r   r   	dynspreadr   
precomputer   r   r   subplotsr   r	   _by_typer
   current_backend_backendrP   compatibility_backend_compatstackedrY   _default_plot_opts_process_plottupler   bool_legend_positionslistr*  updatepop_process_style_style_optsr  _colorbar_types_kind_optionsappendgetattr
_color_dim_process_symmetric_process_categorical_datashader_default_cmaps	TypeError
_plot_optsitemsr(   objects_overlay_opts
_norm_optskwds_relabel_dim_ranges_validate_kwdsr   r   r   r7  r   format)]r[   datar   r   r   r   r   r   r   r   r   r   r   fieldsr7  r   r   r   r   r   r   r   climrobustr2  r   r   r   r'  
hover_colsr.  r-  rJ  r5  r   rP  r   r   r   r   r   r   rowcoldebugr3  r   r   r/  r   rI  
flip_xaxis
flip_yaxisrH  r   r   r   r   r%  attr_labelsr   r   r>  r   check_symmetric_max
transformsstreamr   r   r   r  r   ri  ccrsr  px0py0px1py1x0x1y0y1extentsplotwdsplotwd	axis_nameaxisignore_optskeyr]   r^   r  s]                                                                                               @ra   __init__zHoloViewsConverter.__init__"  s	   X "&
)	
. S-WiQYZ[88t}}337884$$T3/!%" 
$*"88yy/

  ((:499- H--1__,?A
 ,5%(4
%/%`ED4H4HW[W_W_D"//43G3GG 7 
 xx:%44%)%9%9%B%B%I%I"S#s+#sB+#sBr2r*!0$((DDZDZ![BB8D8D5 %/D" $S)Y
1S-TI  +""$"$$$$& !$,)--))1#'==D #3#A#AD 00ID4F4F4HI	 %dIf %dIf %.Ik">6D>6D $If $If%)Ik"'+F|Im$T++++1I'(..88<T=S=S8T7UUWY  +/I'(/40  1
2 F~$(HHV$4	&!  -1,?,?i,P))T+ID xx	*+/Ii(+/Ii()+MM)T2 , (,In%(,In%88IMM-8'(Im$\===!*w!<Ig"+--#">Ihh%$,Ij!YY$...$(Ij!^^$-MM*d$CIj!==$,1C}}( !TUU"mmw6(LC$*DS!T>f(:(:(>(>tyy"(MM $ 0If'+yyF':Im$"(;kD!IdOU?tIMM'2$>?;E]&E 

 
 ***/	,'LL!e.<	*+0@	,-"	'88)6Io&&*&<&<Il#*h0M!&IgII---~~~~ $ 7 7	4I\ ]I##''/7;;=a@373F3F}3U((0"373F3F{3S((0373F3Fx3P((037I/0(-6Ik* !&Ig".3JI/0#!__224
4TQ[=N=N=V=V=X8XAqD4
 )29==Q^C_?_`	 
,1%(r!56 	D!&&&&77YYYYD JJ$$O HHNWQUW -  
s   0B)c (c/4c/	c,+c,c                    d\  }}| j                   s| j                  s||fS t               }d}| j                  ry| j                  }t	        |t
              r9| j                  r-|dk(  } t        |j                  |      | j                        }nCt	        ||j                  |j                  f      }n| j                  r&|j                  j                  | j                        }n| j                  r7| j                  s+|j                  j                  | j                  d         }d}nt	        | j                  t              rt        | j                        dkD  sC| j                  lt        t!        | j"                        t!        | j$                        z
        dkD  r5| j&                  dv r'|j                  j                  | j(                        }d}t	        | j                  t              xr t        | j                        dkD  xsG | j                  d u xr7 t        t!        | j"                        t!        | j$                        z
        dkD   ||fS )NFNF	count_catr   Tr3   )r   r   r   )r   r   rM   r   r*  strr_  r^  
reductionsr  r   meanrJ  r   rV  lenset	variablesindexesr   r   )r[   r  aggdss       ra   ra  z2HoloViewsConverter._process_categorical_datashader  s   &S$..## ??//C#s#![01gbmmS1$//B(r||RUU.CD__--$$T__5CWWT]]--))$''!*5CK%#dff+/3s4>>':S=N'N#ORS#Sii66--))$*:*:;CK %9#dff+/ U$S3s4>>':S=N'N#ORS#S Cri   c                 h   |||S t        | j                        rO| j                  | j                     }t        |dd      r|j                  ryt        |      r|j                  |kD  rzyy| j                  rk| j                  | j                  j                  v r| j                  | j                     n.| j                  j                  j                  | j                        }ny |j                  dk(  ryt        j                  |d      }t        j                  |d      }t        |dk  xr |dkD        S )N
_in_memoryTFr   g?gffffff?)r?   rn  r   r^  chunksr@   sizer_  r   indexget_level_valuesnpnanquantilerT  )r[   r2  rp  ry  rn  cmincmaxs          ra   r`  z%HoloViewsConverter._process_symmetric  s     D$4TYY99TVV$D4t4"4(9922 __ ??dii&7&77 		$//*YY__55dooF  99>~~dD)~~dD)D1H)**ri   c                 b   t        |d      r;|j                  j                  %|j                  j                  j                         }n4t	        |t
              r"t        |di       j                  |xs d|      }n|}	 t        |      S # t        $ r}|rt        d| d|       Y d}~yd}~ww xY w)zGGiven crs as proj4 string, data.attr, or cartopy.crs return cartopy.crsrioNattrsr   'zV' must be either a valid crs or an reference to a `data.attr` containing a valid crs: )
hasattrr  r   to_wktr*  r  r^  r  rA   rE  )r[   rn  r   _crses        ra   r<  zHoloViewsConverter._process_crs  s    4DHHLL$<88<<&&(DS!4"-11#,DDD	t$$ 	 u ==>CA  	s   =
B 	B.B))B.c                 T!  :; || j                   v }d}d }| _        t              | _        | j                  rj                         t	              rt        |	xs |
      t              | _        |t        |t              s|g}|t        |t              s|g}g }||j                  |       ||j                  |       d}t              rt        d      rdnd}| _        ||dk(  r:j                  D ch c]  }|r	d|v r|dd  n| }}d |v r\|j                  d        nJt!        j"                  j$                        j&                  j)                  dd      j)                  dd      g}t+        |      d	kD  rt-        d
      t        |      d   }|dk(  rd}n|dk(  rd}n|dv rd}|I|F|j/                  d|j/                  d|            |d<   d }nt        t0        j2                        rd}| _        nt5              rd}|
rj7                         n| _        nt9              rd}| _        nt;              rd}| _        nt=              rd}| _        nt?              rd}j@                  | _        t        | j                  t0        j2                        r| j                  jB                  d d | _        jD                  | _#        d}| _$        jD                  dk(  rtK        | j                        | _&        ntO        | j                  |d      | _&        jL                  jQ                         jS                  | jL                  jT                         ntW              r_dd l,}|j[                  d      }t        |j\                        r#t+        j^                        dk(  rt-        d      |Ct        |j\                        rt        j^                        d   }nj`                  xs |xs |}|r+t        |j\                        rt        |t              s|   || _1        |xs g |xs g z   |z   } jd                  D !cg c]  }!|!   jf                  d k7  s|!| vs|! }"}!jh                  D !cg c]  }!|!   jf                  d k7  s|!| vs|! }#}!||s|rtk        fd!||fD              rjt        jd                        g d"k(  rd#}d}nKt+        |"      d	k(  rd$}n:t+        |"      d%k(  s%|r|s!t+        |"D !cg c]	  }!|!|#v s|! c}!      d%k(  rd&}d}nd'}|	rdnd}|rd(}d}|d#k(  r2d)|v r|d)   g}$n)jd                  D %cg c]  }%|%|xs g vs|% c}%d   }$ng }$}tm        |||||	|
||||$|*      \  }}}&}'|d#k(  r|rto        jp                  |   d+      }(to        jp                  |   d%      })|   js                  d,      |)z
  |(|)z
  z  js                  d-      |<   to        jt                  to        jv                  |   d      d	      |<   || jx                  vr||&}||'}|r|D *cg c]	  }*|*|vs|* }}*|sn|slt        ||jz                        r|j}                         | _?        n@t        ||j\                        r* t        |jz                  j|                  |             | _?        | _        n"t-        d.t!              j&                   d/      |e|rt-        d0      || _&        d | _$        t        |tJ              rd| _#        n0t        |tN              rd1| _#        nt-        d2t!        |       d3      d}|g }|g }|r|D *cg c]  }*|*jd                  vs|* }+}*t        |+      \  },}-}-t        j\                        rt        j^                        nj`                  g}.t        jd                  j                        ;||;vr;j                  |       ||;vr;j                  |       jh                  D ]  :t        :fd4;D              rjd                  D ]p  }/|/;vs:ht        |/   jh                        k(  s%;j                  :       | j                  j                  :|/i      | _        |/||z   vs`|j                  :       r  t        jd                        |.z   | _F        | j                  j                  |+D 0cg c]	  }0|0|,vs|0 c}0       |r|,rt-        d5|+ d6t        jd                               |r2|d7vr.t-        | d8t!        | j                        j&                   d9      t        d:      rEt        j                  d;      r/j                  j`                  r|sj                  j`                  }n|sd<}t        j                  t0        j                        rB|d=v r>|<|s:j                         j                  d	      j                  d>|i?      | _        |}d@}t        | j                  t0        j2                        rt| j                  j                  j                  d gk(  r&| j                  j                  j`                  xs d@g;nt        | j                  j                  j                        ;nt        | j                  dA      rL| j                  j                         j                  D !cg c]  }!|!| j                  j                  vs|! c}!;n=| j                  j                  D !cg c]  }!|!| j                  j                  vs|! c}!;t+        ;      d%k(  r|s|s|s|dBk(  r;\  }}n	|dCv r;\  }};t        | j                  j                        z   | _F        t        | j                        s3t        ;fdD|D              r| j                  j                         | _        t        |tn        j                  t0        j                  f      rg }1nt        |t              r|n|g}1||1z   D *cg c])  }*|*t        | j                  j                        ;z   vs(|*+ }+}*t        | j                  |+;      \  },| _        |r0|,r.t-        d5|+ d6t        | j                  j                               | j                  j                  |+D 0cg c]	  }0|0|,vs|0 c}0       |r5 t]        | j                  ;      j                  d i |j                  | _        || _T        || _U        |xs d$| _V        || _W        || _X        || _Y        |	| _Z        ;| _B        |xs d<| _[        t        |tn        j                  t0        j                  f      rE| j                  j                  |E      | _        dFg| _]        | j                  j                  dF       n$|sg | _]        nt        |t              r|n|g| _]        || _^        || __        || _`        |sg | _a        nt        |t              r|| _a        n|dGk(  r| j                  r| j                  | _a        n]|dGk(  r;| j                  s/| j                  D 2cg c]  }2|2| j                  vs|2 c}2| _a        n|dGk7  rt        |t              r|g| _a        | j                  dHv r%| j                  D !cg c]
  }!|!dIk7  s	|! c}!| _a        ||du s|	 |jd                  D 3cg c]  }3|3||3   j                  f }4}3t        |j\                        r9|4j                  |j^                  D 3cg c]  }3|3||3   j                  f c}3       n'|4j                  |j`                  |j                  f       i }5i }6|4D ]=  \  }7}8|7dJ}7t        |8j[                  dK      t              r|8dK   |5|7<   dL|8v s6|8dL   |6|7<   ? | j                  |5dM      | _f        | j                  |6dN      | _f        y y c c}w c c}!w c c}!w c c}!w c c}%w c c}*w c c}*w c c}0w c c}!w c c}!w c c}*w c c}0w c c}2w c c}!w c c}3w c c}3w # t        $ r?}9|du r1t        j                  j                  j                  dO|9        Y d }9~9y Y d }9~9y d }9~9ww xY w)PNF	geom_typer  spatialpandasMulti    Dtyper3   zRThe GeopandasInterface can only read dataframes which share a common geometry typer   Pointrz   Polygonr}   )
LineStringLineRingLiner|   r   r   pandasdaskduckdbcudfibisstreamzTupdatingrn  )rn  lengthr  r   z+Cannot plot an empty xarray.Dataset object.rr   c              3   :   K   | ]  }|j                   v   y wrl   )coords)r  r   rn  s     ra   r  z3HoloViewsConverter._process_data.<locals>.<genexpr>p  s     4Vv!Q$++5Ev   )bandr   r   ry   r      ru   r   xarrayr   r   b   f8f4zSupplied data type z not understoodz4Cannot supply streamz.DataFrame and stream argument.	streamingzStream of type z not recognized.c              3   @   K   | ]  }|   j                   v   y wrl   )dims)r  r   rn  data_dims     ra   r  z3HoloViewsConverter._process_data.<locals>.<genexpr>  s     EW8tAw||3Wr  z"The supplied groupby dimension(s) z. could not be found, expected one or more of: )rz   r{   zN plot type requires gridded data, e.g. a NumPy array or xarray Dataset, found z typer   rV   Variable)Nr  level_1)r   r  reset_indexr   )r   r   c              3   ,   K   | ]  }|v s|  y wrl   rr   )r  gr  s     ra   r  z3HoloViewsConverter._process_data.<locals>.<genexpr>  s     3Ww!!w,Aws   	)_byr  allr  r  geometryr  	long_nameunitsr5  unitz0Unable to auto label using xarray attrs because )k_gridded_typesdata_sourcer7   to_framer:   rB   rL   source_datar*  rV  r]  rI   r  rn  r  removetyper  dtyperm   replacer  rE  rX  pd	DataFramer8   r   r9   r;   r=   r<   exampleiloc_stream_typestream_typecbr.   r{  r-   gathersinksendr?   r  r  r   	data_varsrV   r   r  shaper  r  rC   r  nanpercentileastypeminimummaximum_stats_types	DataArray_title_for_slicer0  r   rJ   r  r:  r  	set_indexr  extendr   r2   stackr  renamer  namesrG   ndarraySeriesrK   	transformr   r   r   r;  griddedgridded_datar   r   assignr   r7  r   r  rr  r   r  r  _merge_redimr8  rg   rW   r@  rA  )<r[   r   rn  r   r   r   r7  rs  rt  r   r   r   r5  r   r   rr  rx  rz  r{  rq  ri  r  r  dar   r  r;  gt
geom_typesr  xrr   ignorer   r  r  
other_dimsdby_newgroupby_newvmaxvminr  	not_foundpost_not_found_r  coorditemby_colsr^   var
var_tuplesr   r  var_name	var_attrsr  r  r  s<     `                                                       @@ra   r9  z HoloViewsConverter._process_data  s>   . $---  "4>>==?DT?!$(;G<D ).z'4'@iG>*R"6B?KK?KK	4 &-dK&@{oHDI|{*SWSaSa!bSaRB7b="QR&b"HSaJ!bz)"))$/ T]]001!'''2"6 "-"J
 z?Q&$7  !,Q/	'#D)+%D"DD"D} $$((32B CWbll+HDIT]H*1tDIt_HDIT]HDIT]HDI HDI$))R\\2 IINN2A.	#00DIDG  J."		2$$))G5QKK %%dkk&6&67t_A$

+t~~&!+$%RSSydBJJ/T^^,Q/A		9U9kA:dBJJ7
1d@SAwDFmb1D8F!%XAQ0CQWaFX#yyTy!DGMMR,?AVOAyDT|a14VPQSTv4V1V$(:: D"G[A%!D[A%!cf:ZfPQUYPY1f:Z6[_`6`"D"G!D!)vxH##u}d?"&w-J-1[[!U[AgmQS<T![!UVW!XJ
B.</+D!Q u} ''Q9''Q3
 !GNN4047D4KHPPQUVQ**RZZQ%;Q?Q4,,,:B?)G&-?g$1g? 4b",,/"$"5"5"7DKBJJ/"L'",,*G*G"L"NDKDI24:3F3F2GWXX !WXX DKDG&$'#- FF+#.  ?4<.@P!QRRI :B?G$+DGqq/CGID#B4#S NAq0:40LT^^,SWS\S\R]I4;;../G}'!1q!}'!1q! IIEWEE!% /XJ#d5kFVFVBW4W#NN84(,		(;(;Xu<M(NDI$GbL8 'x 8 "- & "$++.:DNNN!!I"\ID^A[4I"\]> 8 D  $T[[ 124  4'<< f !$))_556e=  i(DLL&1LL%%#"ll// ( 4<<7(I
 !JJL44Q7>>	S^G_>`	  $))R\\299??((TF2#yy33>w?G"499??#8#89GM2#yy446>>>!!499K\K\B\A> '+ii&7&7V&71DIIDUDU;U1&7V7|q !qB9$"DAq_,#EAr$tDII,=,='>>DN !+3Ww3W0W II113	"rzz29956 *2t 4"2$"W,,adii>O>O9PSZ9Z0Z,   )H		9g)%NDI > 8 D  $TYY%6%6 78: 
 NN!!I"\ID^A[4I"\]=		73==K
KPPDI NF	 ( &4*b2::ryy12		((R(0DIgDGNN!!%(DG&r40brdDG	" DO
D)(DO5 T^^"nnDO5 *...R.QAT\\<Qq.RDO5 Z
C%@)lDO==::*.//M/QQ*_q/MDO>kT1[5H>@iiHissBsGMM2i
Hb"**-%%r||&T|RW]]';|&TU%%rww&9:+5'Hi'#*!)--"<cB+4[+Ax()+*3G*<h ,6 #//@"//v># 6I]	 "cL YT ;[ "VJ @D E$ #]Z W$ #]D S
 N I&T  $&JJ$$,,MaSQ  's  A@%A@=A@A@A@.A@3A@ 	A@*A@)A@#7A@#	A@(!A@(7A@-A@-	A@2A@2A@7"A@7A@< A@<)AA1AA!	AA+AA AAAA
AA%AA;AA 	AA!1AA AA*A*AA 8AA A
AA A	AB'A(0AB"B"AB'c                 t   | j                   }t        j                  d      }| j                  |   j                  }||v r||   j
                  d   j                  ni }|j                  d      r| j                  |d<   |dk(  r5| j                  r)t        j                  j                  j                  d       |S )NrQ   backendplotr   rP  r   zcStacking for histograms is not yet implemented in holoviews. Use bar plots if stacking is required.)r   r
   options_kind_mappingrm   groups
startswithrP  rW   r@  rA  )r[   r   r  elnamer  s        ra   rR  z HoloViewsConverter._process_plotm  s    yy--0##D)22>D>OGFO**62::UW	??5!#'<<Ii 6>||

  ((H
 ri   c           
         | j                   }| j                  |   }t        j                  | j                     }||v r||   j
                  }ng }d}g d}|D ]/  }	|	|vst        ||	   t              r|	|v rt        ||	         ||	<   1 t        j                  | j                        }
|j                  }||
v r|
|   j                  d   j                  ni }|j                         D ci c]  \  }}t        |t              r||vs||  }}} |j                  di |j                         D ci c]  \  }}||v s|| c}} t        |      j!                  |      }t#        |      dkD  rt%        d      |r|j'                  |j'                               nd |j'                  d|j'                  dd             }|| j(                  s| j*                  rk|| j,                  | j.                  fv rQ| j0                  j3                  | j0                  |   	      | _        d
x|d<   }| j4                  j7                  d
       nst        |t8        j:                  t<        j>                  f      rD| j0                  j3                  |	      | _        d
x|d<   }| j4                  j7                  d
       n||d<   t        |t              sz|| j4                  v rld| j@                  jC                  |g       v rN| j0                  |   jD                  j                   dv rxs | jF                  d   n|jC                  dd      |d<   t        tH              r| jF                  v r| jF                     |d<   d|v r|d   }nrt        tJ              sQt        tH              stM              r3tO        fd|D              rtQ        xs | jF                  d   d      }n}n|jC                  d      }|j                         D ]  \  }}t        |t              st        |tH              s(|k(  rw|tR        jT                  vr1|jW                         tR        jT                  v r|jW                         }n%tY        tQ        |            tR        jT                  |<   tS        |      ||<   t        |t              rt        |      ||<   |||<    |j'                  d|j'                  dd             }|8|jC                  dd      }| j(                  s| j*                  r)tZ        j\                  jZ                  j_                  d       t        |t8        j:                  t<        j>                  f      rZt9        j`                  |      |z  }| j0                  j3                  |      | _        d|d<   | j4                  j7                  d       n}t        |tH              r%t9        j`                  tc        |            |z  |d<   nHt        |tb              s8t9        j`                  |      |z  |d<   nd|v rt9        j`                  d      |d<   d|v r/d| j@                  | j                      v r|j'                  d      |d<   |||fS c c}}w c c}}w )N)r   r   r   )
accentcategorydark
colorblindpastelset1set2set3pairedglasbeyr  styler3   z:Specify at most one of `cmap`, `colormap`, or `color_key`.r   r   )_colorr+  OSUr  r   Tr   c              3   <   K   | ]  }|t        d       v   yw)rV   N)r^  )r  categorical_cmapr   s     ra   r  z4HoloViewsConverter._process_style.<locals>.<genexpr>  s)      D(9$ !GD&$$??(9s   r  valuesr  r   r   zThere is no reasonable way to use size (or s) with rasterize or datashade. To aggregate along a third dimension, set color (or c) to the desired dimension.)_sizer2     r   rr   )2r   r  r
   registryrO  
style_optsr*  rV  r   r  rm   r  kwargsre  rW  r  intersectionr  rc  rX  r   r   r   r   rn  r  r  r]  r  r  r  r  r\  r  r  rb  r  rY   rO   r:  r*   r   	colormapsr   r)   rW   r@  rA  sqrtr/   )r[   ri  r  r   eltyper4  
valid_opts	cmap_optscategorical_cmapsr  r  r  r*  r]   r^   r5  	cmap_kwdsr   r  r   r   s                       @ra   rY  z!HoloViewsConverter._process_style  s   yy##D)>>$"6"67X!&)44JJ5	
 C$jcD&ASIEUd3i(DI  --(<(<=:@G:K&&w/66QS"[[]
*TQ*Q2F1T]K]AqD] 	 
 	
OdjjlNldaa:oQTlNO 	N//5	y>AXYY,5txx	(4$((3"56$..e?O6O II,,DIIe4D,E	.66
7#e%%h/EBJJ		#:; II,,E,:	.66
7#e%%h/&+
7# ud+T^^+4--11$;;99U#))..%7E4#6#6}#ED,5MM*d,KIj)dC TT-@-@%@&&t,D!%Jvj w'ED$' 4%T): D(9D A %T%OT-@-@-O]abNN7+EKKMDAq!U#
1c(:D=G$5$55%++-7K\K\:\ %3ElSXFY3Z))%0$+ENJqMt,$)$7JqM$)JqM " xxd 34HHWa(E~~

  ((L
 $RYY 78wwt}u, II,,4,8	%,
6"%%g.D#&%'WWSY%7%%?
6"c*%'WWT]U%:
6"z!!#Jv tD,>,>tyy,I I#'88H#5Jx 9d**A
 Os   +ZZ	Z2Z?Zc           
      
  	
 | j                   j                  | j                  g       	| j                  }| j                  |   }|t        j
                  | j                     v r+t        j
                  | j                     |   j                  
ng 
ddgt        	
fd|D              }|sy d|v rI|j                  |j                  d             t        j                  j                  j                  d       d|v rI|j                  |j                  d             t        j                  j                  j                  d       | j                  | j                  z   | j                   z   | j"                  z   	z   
z   }| j                  dk(  r|| j$                  z   }|D ]`  }t'        j(                  ||      }t        j                  j                  j                  | d	| j                   d
| j                   d|        b y )Nmax_px	thresholdc              3   8   K   | ]  }|z   z   vs|  y wrl   rr   )r  r]   ds_opts	kind_optsr;  s     ra   r  z4HoloViewsConverter._validate_kwds.<locals>.<genexpr>
  s#     Yt!q	G8Kj8X/XAts   axzhvPlot does not have the concept of axes, and the ax keyword will be ignored. Compose plots with the * operator to overlay plots or the + operator to lay out plots beside each other instead.figsizezhvPlot does not have the concept of a figure, and the figsize keyword will be ignored. The size of each subplot in a layout is set individually using the width and height options.rQ   z option not found for z plot with z; similar options include: )r\  r  r   r  r
   r4  rO  r5  sortedrX  r  rW   r@  rA  _data_options_axis_options_op_options_geo_options_style_optionsdifflibget_close_matches)r[   ri  r   r:  
mismatchescombined_optsmismatchsuggestionsrC  rD  r;  s           @@@ra   rl  z!HoloViewsConverter._validate_kwds  s   &&**499b9	yy##D)U^^D$8$899(<(<=fEPPJJ[)YtYY
:NN:++D12JJ$$ 
"NN:++I67JJ$$C   !   	
  	 7*)D,?,??M"H!33HmLKJJ$$*2499+[''((CK=R #ri   c                    ()*  j                   xs |}t         |      * j                  } j                  j	                  dg       }t        |t              s|g}| j                  z  } j                  r|dk(  s| j                  z  }|st        |      dkD  r j                  rt        d       j                  }t        |      s0 j                  s$t         fd|D              r|j!                         } j"                  dv rE|j$                  D cg c]
  }|dk7  s	| }} j&                  rdd	gnd
dg}	t)        ||	|z         (n j"                  dk(  rdd l}
t        ||
j(                        r|dk(  rt-        |j.                  j1                               }t-         j2                        |z
  }|D ci c](  }|t5        j6                  ||   j8                  d         * }} |j:                  dBi |}t)        | j2                        (nV|j<                  xs  j>                  xs  j@                  }t)        | j2                  |      (nt)        | jB                        (tE        (fi  jF                  (|r(j                  | jH                        )t        |      dkD  rtK         jL                  |      g)jN                  z   } jH                  r0) fd}tQ        ||      }(*fd}|jS                  |dd      }ntU        )j                  jW                         D ci c]  \  }}|D ]  }|f|z    *|(|          ! c}}}|      }n(*fd})jS                  |dd      }nt        |      dkD  ritK         jL                  |      g} jH                  rtQ        (*fd|      }nFtU        |D ci c]  }| *|(j                         c}|      }n *(j                        } j                  rS j                  rG|dk(  sB jX                  r|j[                   j                        n|j]                   j                        } j                  r|j                   j                        j_                  ddd      }nt j                  rMta        *      } jb                  |}nte        | jb                        }tQ        | jf                  g      }n jh                  } j"                  dv rD|j$                  D cg c]
  }|dk7  s	| }} j&                  rdd	gnd
dg}	t)        ||	|z         (n j"                  dk(  rqdd l}
t        ||
j(                        rt)        | j2                        (nm|j<                  xs  j>                  xs  j@                  }t)        | j2                  |      (n-	 t)        | j2                        (tE        (fi  jF                  ( *      }(|_6         jn                  r- jp                  r!dd l9}|jq                  | jt                        } jv                  s6 jx                  s* jz                  s j}                  |      }t        |      }|S t         jH                        } j                  j	                  d       j                  d   |d<    j                  j	                  d        j                  d    |d <    jz                  r	 dd!lBmC} t         jz                  t              r jz                  |d#<    j                  r j                  |d$<    j                  j	                  d%       j                  d%   |d&<    j                  |||      }t        |      }|S t                dd'lIm;}m<}mJ}  j                         \  } }!|!r|!|d(<    j                  r j                  |d)<    j                  r j                  |d$<    j                  r j                  |d*<    j                  j	                  d%       j                  d%   |d&<    j                  j	                  d+       j                  d+   |d,<   d- j                  v r] jv                  rQ j                  j	                  d.      }" j                  d-   }#t        |#t              r|#|d/<   nt        |#|"| 0      |d-<   d1 j                  v r j                  d1   |d1<   i }$ jv                  rp|}%d-|v rd/|vr|d-   |d/<   d2}&d3 j                  v r j                  d3   |d3<   d4 j                  v r j                  d4   |d4<    j                  r j                  |d5<   n jx                  rt|}%| rd6nd7}&d- j                  v r j                  d-   |$d-<    j                  j	                  d8d9      d9k7  r j                  d8   |$d:<    j                  r j                  |d5<    j                  %||      }' j                  r? ||' j                  j	                  d;d<       j                  j	                  d=d>      ?      }'t        &t         j                  fi |$d@      }  j}                  |'      j^                  |&fi |dAdi}t        |      }|S c c}w c c}w c c}}}w c c}w c c}w # tj        $ r t)        |      (Y w xY w# t        $ r t        d"      w xY w)CNr   rz   r3   z)Streaming and groupby not yet implementedc              3   :   K   | ]  }|j                   v   y wrl   r  )r  r  r[   s     ra   r  z.HoloViewsConverter.__call__.<locals>.<genexpr>G  s     :6aT\\)6r  r  r  	LongitudeLatituder   r   kdimsr  r   ru   )r   r0  c                      | j                  j                        } j                  di | }|j                  |j	                  |      g      S )N)vdimsrr   )rX  r   selectreindexget_dimension)r6  r   r  datasetsr[   s      ra   	z_wrapperz.HoloViewsConverter.__call__.<locals>.z_wrapperh  sI     &

4+;+; <A!0!:6!:B#%::R5E5Ea5H4I:#JJri   c                     | j                   d   j                  } |||| j                        }j                  |_        | |_        |S )Nr   r  )r[  rV   rn  _transforms_dataset)r  r   r   r   elr{   methods        ra   method_wrapperz3HoloViewsConverter.__call__.<locals>.method_wrappero  sC     " 0 0A!'1abgg!>B-4-@-@BN*,BK#%Iri   TF)r   r   per_elementlink_inputsc                 b     ||| j                         }j                  |_        | |_        |S Nr  )rn  rb  rc  )r  r   r   rd  r{   re  s       ra   rf  z3HoloViewsConverter.__call__.<locals>.method_wrapper  s.    #Aqrww7)0)<)<&(!	ri   c                 0     | j                         S rj  r  )r   r{   re  r   r   s    ra   <lambda>z-HoloViewsConverter.__call__.<locals>.<lambda>  s    &Aqw||"Dri   r  rQ   )shared_xaxisshared_yaxisr  )rd   )streamsr   r   r   )downsample1dz&Downsampling requires HoloViews >=1.16	algorithmr   r   x_range)r   r   rH  r   rI  r   r   y_ranger   color_levelsr   r/  
line_widthr#   r   r   r   
ImageStackr   r   r6  rp  r@     rA        ?)r@  rA  r  r  rr   )Sr   r^  r7  ri  r  r*  rV  r   r  r   r  r  NotImplementedErrorrn  rG   r:  r  r;  r   r   r   r  r  r  keysr  r  aranger  assign_coordsrV   r5  r   r  rF   r8  r   r   r   rY  r   applyr   re  rJ  layoutoverlayoptsr   r  rS   r{  r  rg   rc  r   r   geoviewsr=  r   r   r   _apply_layersr4   rY   rd  holoviews.operation.downsamplerq  ImportErrorr  r   _resample_objrM   holoviews.operation.datashaderrH  ra  rI  r   rZ  r*   r   rk  r5   )+r[   r   r   r   r  zsrn  r   r   
shape_dimsr  dims_with_coordsmissing_coordsr  
new_coordsrV   
dimensionsr`  objrf  r]   r^   r   r  
cbcallablegvlayersr  rq  r   r   rH  r  r  r   r   r*  	operationr:  	processedr{   r_  re  s+   ` ``                                    @@@ra   __call__zHoloViewsConverter.__call__5  s	   yy Dt$YY]]3#"d#B$))<< 0dggFSWq[~~)*UVV99D!$':6::'')}} >>&*llFla:o1lF:>((k:6c

!$j7.BC(*#dBJJ/w+.t{{/?/?/A+B(),T\\):=M)MP^&P^uE299T%[->->q-A#BBP^ # &  2t11?J?%dDLL9G99F

Fd6F6FD%dDLL$?G!$7W44G"??64<<?Hr7Q;"+D,<,<R"H!IHNN!ZJ||K
 )*E& "ii*a1$TY (  & -5MM,?,?,A,ADAq)+A "#q&Aq'!**E E)+ !),A
 #-" #..&!qdPU ) C R1'(8(8DE
<<$DJC "HJK1F1a>>KS]C Q5||0@-1]]cjj)DGG@Tyyhhtyy)..!%D' /  ~~VQ*77?!#J!22!HJ dkk]C''==$BB*.,,J,Q!z/q,GJ>Bhh+z!:SRUJJ%d*w2FGG]]h.'!$

3")$"=#yyJDJJJ$:J:J")$d"C0")$"= %W<<GQl&88!**ST-C-C*DC$..DOO'',F/7FMDLL)??w'3 OOG4DM??x(4!__X6DN??LG $//3/$(OO[!%)__\"""6*6"&//&"9Y''c4@F/7FMRR??AS!$D??!%D??!%D??!%D??v&2"oof5DO??v&2"oof5DOT%%%$..__((8F##F+D$%$([!+D&kRV4+++!%!1!1,!?D>>!I~+T"9$(L[!F$//) $ 8W(DOO;26//B[2\./&*&6&6]#^^!I%0\gF))) $ 0 0 8f##C6,F $ 0 0 5f&*&6&6]#&&y#t<	>>!yy}}Xq1))--S9I 64#A5#A7S3##I.33FTdTGT+F3o G&J4 L, K % 0")$-06  L!"JKKLsH   
j=#j=<-k1$kk&
k1kk k3 k0/k03lc                 p      fd} j                   t        |t        |fi ||      }|S  ||fi |}|S )Nc                 4    t        |       j                  kD  S rl   )r  r   )r  r[   s    ra   exceeds_resample_whenz?HoloViewsConverter._resample_obj.<locals>.exceeds_resample_when&  s    t9t1111ri   )r  	predicate)r   r,   r   )r[   r  r  r  r  r  s   `     ra   r  z HoloViewsConverter._resample_obj%  sQ    	2 )"wy9D9EZI
  "#..Iri   c           	          t        | j                  fi t        | j                  fi | j                  }|j	                  |       t        |||      S )Nr  )rY   rd  rZ  rh  rW  r5   )r[   r:  r  customr  s        ra   	_get_optszHoloViewsConverter._get_opts1  sD    DOOQtD,<,<'P'PQF6499ri   c                    | j                   rdd l}|j                  j                   j                         }| j                   dv r|j	                  | j                         }n7| j                   dur)t
        j                  j
                  j                  d       ||j	                  | j                        z  }| j                  rdd l}t        | j                        D ]  }t        |j                  |      }|t        d|d      |j                         }t        | j                  t              rS| j                  |   }|dvr.t
        j                  j
                  j                  d	| d
       n|j	                  |      }|j                  dv r |j	                  | j                        |z  }||j	                  | j                        z  } | j                   rh| j"                  s| j%                  | j                         }n| j%                  | j                   d      } |j                  dddi| j&                  }||z  }|S )Nr   )10m50m110m)r   TzWcoastline scale of {self.coastline} not recognized, must be one '10m', '50m' or '110m'.rp  zFeature zl was not recognized, must be one of 'borders', 'coastline', 'lakes', 'land', 'ocean', 'rivers' and 'states'.zFeature scale of z7 not recognized, must be one of '10m', '50m' or '110m'.)LandOceanr  )librb   rr   )r   r  featurerb   r  rW   r@  rA  r=  r   reversedr^  rE  r*  rY   groupr   r   
_get_tilesr>  )r[   r  r  r   r  feature_objr   r   s           ra   r  z HoloViewsConverter._apply_layers6  s   >>!

,,224I~~!77%NNN@	t+

  ((. 	$2H2HIIC==!#DMM2%bjj':&$"7+ .1 1 
 *//1dmmT2 MM'2E$::

((00/w 7E E
 '2&6&6U&6&C$$(99%**d6L6L*MPSSC  0 0D<R<R 0 SSC/ 32 ::88

3


CEJJ=T=T__=E#+C
ri   c                    |dk(  rWdd l }|j                  j                  }|j                  j                  }|t        j                  j
                  j                  f}n@t        j                  j                  }t        j                  j
                  j                  }|}|dk(  rdn|}d }|du r |d          }n|t        |t              r||v r ||          }n]||j                         v r |       }nCt        ||      r|}n4dt        j                  v r"dd l}	t        ||	j                        r ||      }|F| d|dk(  rd	nd
z   ddj                  t        |             dz   |dk(  rdnd
z   dz   }
t!        |
      |S )Nr  r   ESRIEsriImageryTOSMxyzserviceszb tiles not recognized. tiles must be either True, a xyzservices.TileProvider instance, a HoloViewsz or Geoviewsr  z basemap string (one of z, z), a HoloViews Tiles instancez, a Geoviews WMTS instance.)r  tile_sourceselementWMTShvr   Tilesr*  r  r1  sysmodulesr  TileProviderjoinrG  rE  )r[   sourcer  r  sourcesklstypestile_sourcer   r  msgs              ra   r  zHoloViewsConverter._get_tilesi  s   *!oo22G**//C"****001Ejj--G**""((CE'-'7mV$"GEN$ES)kW.D(GK(*EGNN,,MEU+Eckk)+{'?'?@K(=-  A A%(J%6>B@99VG_566SUU
 47*3D/"N   S/!ri   c                 V   t        | j                        }|j                         D ]  \  }}||i}||v rl||   }t        |t              r |j
                  di |}nFt        |t               rd|vrt        |fi |}n%t        |t        t        f      rt	        |fi |}n|}|||<    |S )Nrangerr   )rY   r8  re  r*  r   rb   rS  r  )r[   rangesattrredimr]   rr  r/   s           ra   r   zHoloViewsConverter._merge_redim  s    T[[!LLNDAqQiGEzAhc9-##)).g.CT*wc/As.g.CeS\2#C373CE!H # ri   c                     t        |t              r|j                  j                  }t        |t              r|| j
                  v r|S y y rl   )r*  r/   	dimensionrV   r  r  )r[   r  s     ra   _validate_dimz HoloViewsConverter._validate_dim  sA    i%!++00Ii%)t~~*E +F%ri   c                 V    | j                  | j                  j                  d            S )Nr   )r  rZ  r  rh   s    ra   r_  zHoloViewsConverter._color_dim  s$    !!$"2"2"6"6w"?@@ri   c                    dD ]a  }| j                   j                  |      }|r|ng |z   }| j                  |      }|;||vs@|j                  |       |j                  |       c t	        | j
                  dd       }|&|vr"|j                  |       |j                  |       | j                  D ]8  }t        |t              s|| j                  v s#|vs(|j                  |       : ||fS )N)r   r  r   r   column)
rZ  r  r  r]  r^  r   rr  r*  r  r  )r[   rY  r[  r*  r  r  agg_cols          ra   _get_dimensionsz"HoloViewsConverter._get_dimensions  s    9E((,,U3I#(%bE9J**95I *,Y'!!), : $//8T:j(W%!!'*I9c*/Z/Y' ) e|ri   c                 v     |j                   di |ddi}|r  |j                   di |d| j                  i}|S )Nr  rQ   rr   )r  rO  )r[   r  cur_optscompat_optss       ra   _set_backends_optsz%HoloViewsConverter._set_backends_opts  s@    ',,;;7;"gllO[O$:N:NOGri   c                      | j                   |fddi|}| j                  dk7  rI| j                  || j                        }|j                         D ci c]  \  }}||vs|| }}}||fS i }||fS c c}}w )Nr  rQ   r  )r  rO  re  )r[   el_namer  r  r  r]   r^   s          ra   _get_compat_optsz#HoloViewsConverter._get_compat_opts  s    !4>>'E7EfE7*..$:N:N.OK,7,=,=,?U,?DAq1HCT1a4,?KU $$ K$$ Vs   A4"A4c                     |s| j                   |   }|t        j                  | j                     vrt	        |d| j                  d      y)zZ
        Raise an error if the element is not available with the current backend.
        z plot not supported by the z	 backend.N)r  r
   r4  rM  rz  )r[   r   r  s      ra   _error_if_unavailablez(HoloViewsConverter._error_if_unavailable  sT     ((.G%..77%(5dmm5FiP  8ri   c           
          |dk7  r j                   rdndgng } j                  s |j                   j                   rdnd       n j                  s| j                  d<   d j
                  v rd|vr|j                  d       d j
                  v rd|vr|j                  d        j                  |j                  |d      } j                  |j                  | j                        }||fD ]4  }d	|v s|d	   |j                  v st        j                  |d	         |d	<   6 |j                  |d
t        d
t         j                  d      d      i}	|j                  |d
t        d
t         j                         j                        i}
|g}|t        u r. j                   j#                  d      r| j                   d   gz  }|t$        u rX j                   j#                  d      r= j                   j#                  d      r"| j                   d    j                   d   gz  }n6|t$        u r. j                   j#                  d      r| j                   d   gz  } j'                  |g|      \  }} j(                  r#|t*        u r j,                  st/        |      s$t1         fd|D              r|j3                         }t5         |||r|gng  j(                  z   |       j                   j6                        j9                  |	d      j9                  |
 j                        S t;        t=        | j(                  |z   |      j?                  ||| j(                        fi  j                  } j,                  r|jA                         n|jC                  d      }nt;         ||||      fi  j                  }tE        |fi  j6                  j9                  |	d      j9                  |
 j                        S )Nr  r   r   r5  r   r   rQ   labelledr  r   r	   Fbatchedr  r   r   r   c              3   :   K   | ]  }|j                   v   y wrl   rU  )r  r   r[   s     ra   r  z2HoloViewsConverter.single_chart.<locals>.<genexpr>  s     2Qb13Dbr  sort)#r   r7   r]  r5  rj  rd  r  rV   rO  r   r  r/   r5   rY   rg  r   ri  r  r$   r  r   r   rJ  rG   r:  r  rE   r8  r  rD   r   tor  r  rF   )r[   r  r   r   rn  r  cur_el_optscompat_el_optsopts_r  r  ysrY  r[  charts   `              ra   single_chartzHoloViewsConverter.single_chart  sq   45L4;;CC0b~~OO4;;CC8%&DMM'"t&3h+>OOC t&3h+>OOC nnW\\HgnVLL8T5I5I ( 
 ">2E%E'Ndll$B!#g!7g 3 LL+T$"4"4eDg
 LL.T$"4"45t?S?S
 Sd?tyy}}T2499T?##BiDIIMM'$:tyy}}W?U499W%tyy'9::B	!diimmG&<499W%&&B++QC4u77$t}}$T*s2Qb2Q/Q++-D!asR477&BBGX\XcXc T(GT4T+t/C/CTD dggou588%PTPWPWX--E '+mmELLNE9REGD%7I4==IE5(DKK(T(GT,T+t';';T<	
ri   c                 v   |du ry|xs | j                   |k7  r| j                   nd}||| j                  r| j                  }nt        |j                        }|D cg c]1  }|| j
                  | j                  z   | j                  z   |gz   vs0|3 }}t        |      r|d   nd}|s|st        d      |S c c}w )z*This should happen before _process_chart_yFNr   z2Could not determine what to plot. Set x explicitly)
r   r   r  rV  r   r   r7  r   r  rE  )r[   rn  r   r   single_y
categoriesxsr   s           ra   _process_chart_xz#HoloViewsConverter._process_chart_x&  s    :2DFFaK$&&T9~~\\$,,'UR1DGGdll,BTYY,NRSQT,T#T!RBUR1dAQRR Vs   1B6B6c                 v   |xs | j                   }||j                  D cg c]1  }||g| j                  z   | j                  z   | j                  z   vs0|3 }}t        |      dkD  r1ddlm} |D cg c]  } |||         s| }	}t        |	      dk\  r|	}t        |      dk(  s|r|d   n|}|S c c}w c c}w )z)This should happen after _process_chart_xr3   r   )is_numeric_dtype)r   r   r   r7  r   r  pandas.api.typesr  )
r[   rn  r   r   r  r   r  isnumr/   num_yss
             ra   _process_chart_yz#HoloViewsConverter._process_chart_y8  s    K9!\\_\QqcDGGmdll6RUYU^U^6^-^!\B_2w{F)+@#uT#Y/?#@v;!#BRA1rA `
 As   1B1B11B6B6c                 P     j                   n j                  st               j                  ||||      } j	                  |||      }| j
                  r j                  dk(  rddlm} | j                  v rct        j                  t              r j                  j                  |      }d|i}nj                  }i } ||      r= j                  di |n*|j                  v r ||         rj!                  |      t#              s; j$                  r/t'         fd j(                  D              rj+                         g }	|| j,                   j(                  fD ])  }
|
|	j/                  t        |
t0              r|
n|
g       + |	D cg c]  }| j2                  vs| }}t5        | j                        \  } j2                  j/                  t7        |      t7        |      z
          j9                  ||      \  }}||fS c c}w )Nr  r  r   )is_datetime64_any_dtypelevelc              3   ^   K   | ]$  }|j                   v s|j                  vs!| & y wrl   r  r   r  r   rn  r[   s     ra   r  z9HoloViewsConverter._process_chart_args.<locals>.<genexpr>d  s+     ^!!t||2CQUQ]Q]H]A   ---rr   )rn  r  rL   r  r  r   r;  r  r  r  r*  r  r2   r  
sort_indexr   sort_valuesrG   r   r:  rr  r  r   r  rV  r  rK   r  _process_tiles_without_geo)r[   rn  r   r   r  r  is_datetimeidx_valssort_kwargsr  rt  r/   r  r  s   ``            ra   _process_chart_argsz&HoloViewsConverter._process_chart_argsG  s   <99D"",T2D!!$1h:!N!!$1h7 =T^^0IODLL djj*5#zz::1=H#*A,K#zzH"$Kx(*4??9[9Ddll"{47';''* d#^t^^##%D 
q$''4??3C!!C)>#SEJ 4 %/LJS#T^^2KSJ	L>tYPTP\P\]c.1C	NBC44T1a@
aQz Ms   #H#7H#c                 *   | j                   s| j                  r| j                  du r|||fS t        |      s	|||||fS t	        |      rnCt        |      r"t        |dd      *|j                  d      }nt        j                  ||         }t        j                  ||         }t        j                  ||         }t        j                  ||         }d|cxk  xr dk  nc xr d|cxk  xr dk  nc }d|cxk  xr d	k  nc xr d|cxk  xr d	k  nc }	|rp|	rn|j                         }||   d
z   dz  d
z
  }
t        |
||         \  }}d|vrdnd}d|vrdnd}|||<   |||<   t        |      r|j                  ||||i      }|}|}|||fS )z;
        Tiles without requiring geoviews/cartopy.
        FNr   i  )epsgiLih  iZ      r   x_r   y_)r   r   r=  rI   r>   r^  to_crsr  minmaxcopyr0   r?   	swap_dims)r[   rn  r   r   min_xmax_xmin_ymax_yx_within_boundsy_within_boundslons_180eastingnorthingnew_xnew_ys                  ra   r  z-HoloViewsConverter._process_tiles_without_geou  s    884::)?)?5)HA: &AIA:T"tUD)5{{{-FF47OEFF47OEFF47OEFF47OE"e2s2Ktu7K7KO!U0b0GSE5GR5GO?yy{ GcMS036$?$q'$R!"$D"$D%U&UT?>>1eQ*>?DQzri   c           
         | j                  |||      \  }}}|r,|r*t        |t        t        f      s| j	                  ||||      S |r'|r%t        |      dk(  r| j	                  |||d   |      S |dk7  r| j                  rdndgng }| j                  dk7  r|j                  | j                  rdnd       d| j                  v rd|vr|j                  d       d| j                  v rd|vr|j                  d       |j                  | j                  |j                  |d	
      dt        dt        | j                  d      d	      i}|j                  | j                  |j                  || j                  
      dt        dt        | j                        | j                        i}g }|D ]x  }	t!        j"                  |	| j                        }
| j%                  |g|
g      \  }} ||||      }t'        || j(                  | j*                        }|j                  |	|f       z | j-                  || j.                  d      j1                  |d	      j1                  || j                        S )z'Helper method for simple x vs. y chartsr3   r   r  r   r   r  r   r   rQ   r  r	   Fr  r  )r5  r  )r  r*  rV  rS  r  r  r   r   r]  rd  rV   r  r5   rY   rg  rO  r  r   r  rE   rj  r8  rK  r   r  )r[   r  r   r   rn  r  r  r  chartsr   ydimrY  r[  r  s                 ra   r  zHoloViewsConverter.chart  s6   --dAq9
a:a$7$$WaD991Q1$$Wa1t<<45L4;;CC0bw&OO4;;CC8t&3h+>OOC t&3h+>OOC  LL$..RY.ZT$"4"4eDg
 LL$..x9M9M )  T$"4"45t?S?S	
 A<<)9)9:D//dV<LE5D%/E!%DEMM1e*%  MM&$"2"2M?T(GT,T+t';';T<	
ri   c                 T    | j                  d       | j                  t        |||      S )Nr   )r  r  r   r[   r   r   rn  s       ra   r   zHoloViewsConverter.line  s%    ""6*zz%At,,ri   c                     | j                   j                  dd      }| j                  |||      j                  dd|z         S )Nr   midr   zsteps-)interpolation)ri  r  r   r  )r[   r   r   rn  r   s        ra   r   zHoloViewsConverter.step  s>    		gu-yyAt$,,WHuDT,UUri   c                 T    | j                  d       | j                  t        |||      S )Nr   )r  r  r   r  s       ra   r   zHoloViewsConverter.scatter  s%    ""9-zz'1a..ri   c                     | j                  d       | j                  t        |||      }| j                  r$|j	                  t        j
                  t              }|S )Nr   )r  r  r   rP  mapr  r	   )r[   r   r   rn  areass        ra   r   zHoloViewsConverter.area  sD    ""6*

4At,<<IIdjj)4Eri   c                 T    | j                  d       | j                  t        |||      S )Nr   )r  r  r$   r  s       ra   r   zHoloViewsConverter.errorbars  s%    "";/zz)Q400ri   r   r   c                     |dk7  r j                   rdndgng } j                  dk7  r|j                   j                   rdnd       d j                  v rd|vr|j                  d       d j                  v rd|vr|j                  d        j	                  |j
                  |      \  }}|g}t         fd|D              r|j                         }|||gz      }t        |d	      rd
dl	m
}	 nt        j                  }	 |	||g j                   j                        }
| j                  g} j                  g j                  z   } j                  r,t        |
||      j!                  ||      j#                         }n
 ||
||      }t%        | j&                   j(                        j+                   j,                  ||      S )K
        Helper method to generate element from indexed dataframe.
        r  r   r   r  r   r   )r  c              3   :   K   | ]  }|j                   v   y wrl   rU  )r  r^   r[   s     ra   r  z4HoloViewsConverter._category_plot.<locals>.<genexpr>  s     2'QqDLL 'r  r  r   melt)id_varsr  
value_namer  r  )r   r   r]  rd  r  rV   r:  r  rH   dask.dataframer$  r  r   rr  rJ  r   r  r  rE   rj  r8  r~  r  )r[   r  r   r   rn  r  r  r  r%  r$  dfrY  r[  r  s   `             ra   _category_plotz!HoloViewsConverter._category_plot  s    56L4;;CC0bw&OO4;;CC8t&3h+>OOC t&3h+>OOC  $ 5 5gllX 5 V+#2'22 ##%DAG}v&+77D$d.>.>4K[K[\D$$%!!"T__4=="eU+..w:AACC"eU+CS$--=CC##hK D 
 	
ri   c                    | j                  d       | j                  |||| j                        \  }}}|s| j                  ri|rg| j                  s&t        |t        t
        fxs t        |      dk(        s5t        |t        t
        f      r|d   n|}| j                  t        |||      S | j                  t        |t	        |      |      S )Nr   r  r3   r   )
r  r  r   r*  rV  rS  r  r  r   r*  r  s       ra   r   zHoloViewsConverter.bar	  s    ""5)--dAqTWW-M
aaTWWJq4-B^SVWXSY]^S^4_"1tUm4!!A$$T1a66""4DGT::ri   c                 J    | j                  |||      j                  dd      S )Nr   T)r"  )r   r  r  s       ra   r   zHoloViewsConverter.barh	  s%    xx1d#((T(BBri   c                    | j                  |d|      \  }}}i }d| j                  v r)t        |t              rdnd}| j                  d   ||dz   <    | j                  |j
                  fi |\  }}| j                  j                  dd      }	t        |t        t        f      sb||	i}
t          ||| j                  |      j                  j                  di |
fi | j                  j!                  | j"                  ||      S | j$                  d	k7  r| j&                  rd
ndgng }| j(                  dk7  r|j+                  | j&                  rdnd
       d| j                  v rd|vr|j+                  d       d| j                  v rd
|vr|j+                  d
       ||d<   | j$                  g}|t        |         }t-        |d      rddlm} nt2        j0                  } ||| j$                  | j(                        }t        |      rf|| j(                     j4                  ||d      j4                  ur;|| j(                     j7                  ||d      j4                        || j(                  <   | j9                  | j(                  |	i      }t;         |||| j(                        | j                  |      j!                  | j"                  ||      S )r!  Fr   r   r   _fill_colorr   r6  r'  Groupr   r   r  r   r   r  r  r   r#  r  r&  rr   )r  rZ  
issubclassr   r  rV   rd  r  r*  rV  rS  rD   r   r  r  rj  r~  r  r   r   r   r]  rH   r(  r$  r  r  r  r   rE   )r[   r  r   rn  r   r  prefixr  r  r   r  r  rY  r$  r)  r  s                   ra   _stats_plotzHoloViewsConverter._stats_plot	  s    --dE1=
ad&&&!+GV!<X%F-1-=-=g-FF6M)* 5 5 5gll Mf M+""6<8!dE]+YF5dggq)//55??-- eD++hKeXY
 594D4D4O4;;CC0UWw&OO4;;CC8t&3h+>OOC t&3h+>OOC '!!"DG}v&+77D$!1!1d>N>NO7r$**+11ad9I9II#%d&6&6#7#>#>tAaDz?O?O#PBt !!4#3#3T":;Bt//0MM
 %''(%
T		Uri   c                 z    | j                  d       t        | j                  t        ||      fi | j                  S )Nr   )r  rF   r3  r   r8  r  s       ra   r   zHoloViewsConverter.boxE	  s3    ""5)d&&z1d;Kt{{KKri   c                     | j                  d       	 ddlm} t	        | j                  |||      fi | j                  S # t        $ r t        d      w xY w)Nr   r   )r   z-Violin plot requires HoloViews version >=1.10)r  holoviews.elementr   r  rF   r3  r8  )r[   r   r   rn  r   s        ra   r   zHoloViewsConverter.violinI	  s]    ""8,	O0 d&&vq$7G4;;GG  	OMNN	Os   A   Ac           	         | j                  d       | j                  |d|      \  }}}| j                  rdgndg}d| j                  v rd|vr|j	                  d       d| j                  v rd|vr|j	                  d       | j                  d|d	      t        d
| j                  d      d}| j                  d| j                        t        d
| j                  | j                        d}| j                  j                  dd       | j                  j                  dd      | j                  j                  dd      d}d| j                  v r*| j                  d   }t        |t              r||d<   n||d<   t        |t        t        f      sgd| j                  vr||   }	|	j                         |	j!                         }}
t#        |	      r!|
j%                         |j%                         }}
n+t'        |	      r |
j)                         |j)                         }}
|
|f|d<   t+        || j,                        }| j,                  rdt/        |j1                  | j,                        fd|i|x}}|j2                  }| j4                  r|j7                         n|j9                  d      }nt/        |fd|i|}t;        |fi | j<                  j?                  |d      j?                  || j                        S d| j                  vr| j@                  j                  d      sg }|D ]  }||   }	|	j                         |	j!                         }}
t#        |	      r!|
j%                         |j%                         }}
n+t'        |	      r |
j)                         |j)                         }}
|j	                  |
|f        |rtC        |      |d<   t+        |      }g }|D ]7  }t/        |fd|i|}|j	                  |tE        |fi | jF                  f       9 t;        | jI                  || jJ                  d      fi | j<                  j?                  |d      j?                  || j                        S )Nr   Fr   r   r   r   r   rQ   r  r	   r  )r   r	   r   r   r   )r   r   r   r   num_binsr  r  r4  )&r  r  r   rd  r]  r  r5   rg  rO  ri  r  r*  intrV  rS  r  r  r8   computer=   executer   r   r+   r7  lastrJ  r  r  rF   r8  r  rh  r   rD   rj  rK  r   )r[   r   r   rn  r  r  r  	hist_optsr   r  yminymaxr  r   histsr  rt  s                    ra   r   zHoloViewsConverter.histQ	  s   ""6*--dE1=
a KKC5cUt&3h+>OOC t&3h+>OOC  hPWX$[$2D2DgV

 T=Q=QR$T//9M9M
 {D9iimmHe4))--e<
	
 TYY99V$D$$(,	*%$(	&!!dE]+$))+!W ffhd2;!%$DR[!%$D)-t	+&tww'Bww(DGG)<WWYWWuzz*.--U]]PU]=V!"??Y? u,,h0k4+?+?@ dii'0C0CJ0OF#Y ffhd2;!%$DR[!%$DtTl+  )26):	+&T]CR<3<)<DLL#wt=t}}=>?  eT%5%5EB++ T(GT,T+t';';T<	
ri   c           	         | j                  d       | j                  j                  dd       }| j                  j                  dd       }||t        d      t	        | j                        }| j                  |||      \  }}} | j                  dddi|| j                  dd      t        d	t	        | j                  d
      d      d} | j                  	 dd| j                  i|| j                  d| j                        t        d	| j                  | j                        d}| j                  j                  dd      }	t        |t        t        f      sx||	i}
| j                  rZt!        |      j#                  t$        |g | j                        }| j&                  r|j)                         n|j+                  d      }nt%        ||g       }n| j,                  |	i}
||   }|j/                  | j0                  | j,                        }t!        |      }t3        |      rO|j#                  t$        | j,                        }| j&                  r|j)                         n|j+                  d      }n=| j,                  dz   }t5        d
t7        g | j,                  |      i| j0                  g      }| j9                  |
      }t;        || j<                  |      j?                  |d      j?                  || j                        S )Nr   r   r   z)hvplot does not support bw_method and indr   r  rQ   r  r	   r   )legend_limit)r   r   r	   r   r6  Fr  r0  z Density)r   ) r  ri  rX  rE  rY   r  r  r5   rg  rO  rd  r  r*  rV  rS  r   r   r  r   rJ  r  r  r   r$  r   r  r	   r   r   rE   rj  r  )r[   r   r   rn  r   r   	dist_optsr  r  r   r  distsr)  r  vdimr  s                   ra   r   zHoloViewsConverter.kde	  s   ""5)IIMM+t4	iimmE4( COHIIO	--dAq9
a*DNNX7XiXNN>7NC$T$"4"41Ew
 +DNN(,(<(<@I NN>4;O;ONP$T//9M9M
 ""6<8!dE]+YFww((q"dggF*.--U]]PU]=V$T1b1&&-F7DD$4$4AQAQRBB2wlD,<,<=*.--U]]PU]=V''*4!1d2t/?/?&F"G$JZJZI[\!!&)%6T(GT,T+t';';T<	
ri   c                 (    | j                  |||      S rl   )r   r  s       ra   r   zHoloViewsConverter.density	  s    xx1d##ri   c                 R   || j                   n|}| j                  rSt        | j                        dk(  r| j                  | j
                  gnd }t        t        ||      fi | j                  S t        t        || j                  j                  d            fi | j                  S )Nr  rX  r   )rn  r  r  r  r   r   rF   r   r8  ri  r  )r[   r   r   rn  rY  s        ra   r{   zHoloViewsConverter.dataset	  s     Ltyyd<<(+DLL(9Q(>TVVTVV$DE'$e4DDD'$		i(@AQT[[QQri   c           	         | j                  d       || j                  n|}| j                  d      \  }}|s|r|dk(  rK|d|j                  j                  fv r1g |d<   d\  }}|j
                  |j                  |j                  f}dg}nn| j                  j                  d|j
                  D cg c]  }|||fvs
| c}d	         }|g| j                  z   }d
| _
        | j                  |||d      \  }}}| j                  |d	   | j                  d   i      }t        |||g|fi | j                  }	d| j                  v r|	j!                  | j                  d         }	t#        |	fi |j%                  | j&                  ||      S c c}w )Nr   r   r   r  r  )r   r  r  r   r   FTr  r   r   )functionr'  )r  rn  r  r  rV   r   r1  ri  r  rr  r   r  r   rk  r   rj  	aggregaterF   r~  r  )
r[   r   r   rn  r  r  r   r   r  hmaps
             ra   r   zHoloViewsConverter.heatmap	  s   ""9- Ltyyd $ 5 5i @+QANqWdjjoo4N/N#%HZ %DAqLL$**dkk:D	A		ct||#O|!qAA|#OPQ#RSAdoo%A"DN11$1t1LJD!Q!!1Q4)9)9#)>"?@taVQ8$--8		)>>4995F+G>HDd$e$**##hK + 
 	
 $Ps   .F

:F

c                    | j                  d       d| _        | j                  |||d      \  }}}| j                  j	                  d      r| j                  d   gng }|| j
                  z  }| j                  d      \  }}d| j                  v r| j                  d   |d<   d	| j                  v r| j                  d	   |d	<   d
| j                  v r| j                  d
   |d
<   | j                  |r|d   nd| j                  d   i      }| j                  d      }t        | j                        }	| j                  r| j                  |	d<   t         ||||g|xs g fi |	fi |j                  | j                   ||      S )Nr   FTrI  r   r   r   r   r   r   r   Countr   r   r'  )r  r   r  ri  r  rr  r  r   rk  _get_elementrY   rj  r   r   rF   r~  r  )
r[   r   r   rn  r   r  r  r  r  r`   s
             ra   r   zHoloViewsConverter.hexbin 
  sx   ""8,--dAq4-H
a $		c 2TYYs^	T__ $ 5 5j A+		)%)YY/@%AH\""#'99Z#8HZ $))#$(IIk$:H[!!!AAaD7T=M=Mc=R"ST##H-dmm$88 HHF5MgdQFAG>v>H%HNN##hK O 
 	
ri   c                 :   | j                  d       d| _        | j                  |||d      \  }}} | j                  di | j                  \  }}| j                  d      }t         ||||g      fi | j                  j                  | j                  ||      S )Nr   FTrI  r'  )r   )
r  r   r  r  ri  rO  rF   r8  r~  r  r[   r   r   rn  r  r  r  s          ra   r   zHoloViewsConverter.bivariate
  s    "";/--dAq4-H
a 5 5 5 OTYY O+##K0gdQF+;t{{;AA##hK B 
 	
ri   c           	         | j                  dt               | j                  dt               || j                  n|}|\| j                  D cg c]  }|| j
                  vs| }}||d      j                  j                  dk(  r|d   }n| j
                  d   }| j                  j                  dd      }|)|j                  D cg c]
  }||k7  s	| c}d d \  }}	}
}n|\  }}	}
}| j                  j                  dd      | j                  j                  d	d
      }}t        |      t        |      kD  j                  ||d      }||	|
|g}|| j                  v r| j                  j                  |       t        t         j#                  || j                  z               }t%        ||g|      }|j'                  |      j                  j                  dv rt        |||||g      }nt)        |      r]t+        j,                  t+        j.                  ||               |z  dz  }|j1                  t        |      |z
  t        |      |z         }n%|j1                  t        |      t        |            }t        |d|d|g      }t        |||
||	g      }| j3                  d      \  }}|j5                  d       ||d<   | j3                  d      \  }}|j5                  dg       }d|v rUt7        |d| fdd| fdd|	 fdd|
 fdd| fg|dd  D cg c]	  }|d| f c}z         ||j9                  d      <   ||d<   | j                  j                  dd      |d<   d|vr|dk(  rd n||d<   d!|vrd |d!<   t;        |fi | j<                  j?                  | j@                  ||"      }t;        |fi | j<                  j?                  | j@                  ||"      }||z  S c c}w c c}w c c}w )#Nr   r   Mr   ry     r   redr   green)TFSUOg       @)lbounduboundrX  rY  r&   r%  r   r'   r'  @OpenHighLowClose)tooltipsr   blackr   r  r  r   r'  )!r  r&   r'   rn  r  r  r  r   ri  r  r   r/   
categorizerr  r  rV  rY   fromkeysr   dimension_valuesr  r  r  diffr  r  rX  r   r  rF   r8  r~  r  )r[   r   r   rn  r  r  r   rt  ohlr   negpos	color_exp	ohlc_colsr[  r  rectssamplingsegmentsrect_cur_optsrect_compat_optsseg_cur_optsseg_compat_optsr%  hcs                              ra   r   zHoloViewsConverter.ohlc#
  s    ""6:6""684 Ltyyd9(,R#T\\:QIRIaL!'',,3aLLLO		k3/9)-B##B2AFJAq!QJAq!Q99==e4diimmKQX6YSVc!f_00C1HI	1aL	OO""1%T]]9t#>?@TA3&q!'',,5rAq!Q<0E2w66"''"Q%.1E9C?\\Q():3q6HCT\U\\QA\?rHa1#=>EBAq!-*.*?*?*M'''"!*g(,(=(=j(I%o  "-e*3!A3LqW%qW%asG$!g& -2!"I6IbB!B4>I67	+E%++g&' !&W $		lG DW<'+,<RQL"<'%'L"(2dkk288##l 9 
 u,,22##mIY 3 
 %o S CD 7s   O&!O&
O+O+O0
c                    | j                  d       || j                  n|}t        |j                  t        t
        f      r|j                         }| j                  d      \  }}| j                  d      }t         ||| j                  j                  d      g       fi | j                  j                  | j                  ||      S )Nr   r   r   r'  )r  rn  r*  r  r1   r2   r  r  rO  rF   ri  r  r8  r~  r  rQ  s          ra   r   zHoloViewsConverter.tablea
  s    ""7+ Ltyyddjj=*"=>##%D $ 5 5g >+##G,D$))--	2B7
kk
 %''(%
T	Uri   c                     | j                  d       d| _        | j                  |||d      \  }}}| j                  j	                  d      }|s%|j
                  D cg c]  }|||fvs
| c}d   }n;||j
                  vr-|j                         }||j                  fdd	      |d
<   d
}| j                  ||g|g      \  }}| j                  d      \  }}	| j                  d      }
| j                  rVt        |      j                  |
||| j                        }| j                  r|j                         n|j!                  d      }n
 |
|||      }t#        |fi | j$                  j                  | j&                  ||	      S c c}w )Nr   FTrI  r   r   c                 (     j                   di | S )Nrr   )rm  )rs  template_strs    ra   rl  z+HoloViewsConverter.labels.<locals>.<lambda>z
  s    3F<3F3F3M3Mri   r3   )r  r5  r"   r  r'  )r  r   r  ri  r  r   r  r~  r  r  rO  r   r   r  rJ  r  r  rF   r8  r  )r[   r   r   rn  r   r   rY  r[  r  r  r  r   rw  s               @ra   r   zHoloViewsConverter.labelso
  sw   ""8,--dAq4-H
ayy}}V$#||?|!qAA|?BD%99;DL JJ'MTUJVDMD++QFTF;u $ 5 5h ?+##H-77T]%%gueTWWEF(,V]]_6>>u>;UFT5%0Ff,,22##hK 3 
 	
 @s   F*Fc                 z     j                   n|xs  j                  }|xs  j                  }|xs  j                  j	                  d      }t              r:dd l}t        |j                        r j                  j                  xs d      t              rt              s; j                  r/t         fd j                  D              rj!                         g }|| j"                   j                  fD ])  }||j%                  t        |t&              r|n|g       + |D cg c]  }| j(                  vs| }	}t+        |	 j,                        \  }
 j(                  j%                  |	D cg c]	  }||
vs| c}        j/                  ||      \  }}|||fS c c}w c c}w )Nr   r   r  )rV   c              3   ^   K   | ]$  }|j                   v s|j                  vs!| & y wrl   r  r  s     ra   r  z;HoloViewsConverter._process_gridded_args.<locals>.<genexpr>
  s+     b?aa4<<6GAUYUaUaLa?r  )rn  r   r   ri  r  r?   r  r*  r  
to_datasetrV   r6   rG   r   r:  rr  r  r   r  rV  r  rK   r  r  )r[   rn  r   r   r   r  r  r  r/   r  r  r  s   ``          ra   _process_gridded_argsz(HoloViewsConverter._process_gridded_args
  s    LtyydKK#s#T?$-DII,@Ad!$'NNb4??bb'')JDGGT__=	(%%:i3NiU^T_` > )3P
c6O
IP#B4TXT`T`#a NDNN!!I"\ID^A[4I"\]44T1a@
aQ1} Q"\s   4F3F3	F8F8c                 p    | j                   |   }| j                  rdd l}t        ||j                        }|S )Nr   )r  r   r  r^  rm   )r[   r   r  r  s       ra   rO  zHoloViewsConverter._get_element
  s3    $$T*88h(8(89Gri   c                 D   | j                  d       | j                  ||||      \  }}}}|r|st        |j                        d d d   \  }}|st        |j                        d   }|g| j
                  z   }t        | j                        }| j                  d      \  }}| j                  |d   | j                  d   i      }| j                  d      }	| j                  r| j                  |d<   t         |	|||g|fi |fi |j                  | j                   ||      S )Nru   r   r   r   r   r'  )r  r{  rV  r  r  rr  rY   rj  r  r   rk  rO  r   r   rF   r~  r  )
r[   r   r   r   rn  r`   r  r  r  r  s
             ra   ru   zHoloViewsConverter.image
  s    ""7+224AqAaAa		?4R4(DAqT^^$Q'AC$//!dmm$ $ 5 5g >+!!1Q4)9)9#)>"?@##G,88 HHF5MgdQFA88BEBHH##hK I 
 	
ri   c                    | j                  d       | j                  ||||      \  }}}}|j                  D cg c]-  }|| j                  | j                  z   | j
                  z   vs,|/ }}t        |      dk  rt        d      |xs |d   }|xs |d   }| j                  j                  d|d         }|t        |j                        d   }||   }t        |j                  |         }|dk  rt        d||fz        t        | j                        }	d	|j                  v r|j                  d	   nd
\  }
}|
dk  r|j                  |   d d d   n|j                  |   }|dk  r|j                  |   d d d   n|j                  |   }||f}t        |      D ]$  }| |j                   di ||ij"                  fz  }& | j%                  d      }| j'                  d      \  }}| j(                  r| j*                  |	d<    ||||g|j,                  d | fi |	}t/        |fi | j0                  j3                  | j4                  ||      S c c}w )Nry   rx  z-Data must be 3D array to be converted to RGB.r  r3   r   r   zgSelected bands coordinate (%s) has only %d channels,expected at least three channels to convert to RGB.res)r3   r3   r~  r#   r   r'  rr   )r  r{  r  r   r7  r   r  rE  ri  r  rV  r  rY   rj  r  r  iselr1  rO  r  r   r   r[  rF   r8  r~  r  )r[   r   r   r   rn  r   r  r   nbandsr`   xresyresr  r  eldatabr  r  r  ry   s                       ra   ry   zHoloViewsConverter.rgb
  sU   ""5)224AqAaA![[X[ATWWt||5Kdii5W,W![Xv;?LMMNN		gvay19T^^$Q'AAwT[['(A:FINPVX 
 dmm$*/4::*=TZZ&6
d%)AXT[[^DbD!4;;q>%)AXT[[^DbD!4;;q>bvAytyy.E1:.5577F  ##E* $ 5 5e <+88 HHF5Mfq!fgmmGV&<GGc)T[[)//##hK 0 
 	
; Ys   -I'Ic                 b   | j                  d       | j                  ||||      \  }}}}|r|s-t        d |j                  j	                         D              \  }}|st        |j
                        d   }|g| j                  z   }t        | j                        }| j                  |d   | j                  d   i      }| j                  d      }| j                  d      \  }}	| j                  r| j                  |d<   t         ||||g|fi |fi |j!                  | j"                  ||	      S )Nrx   c              3   F   K   | ]  \  }}|j                   d kD  s|  ywr3   Nr  r  r]   r^   s      ra   r  z.HoloViewsConverter.quadmesh.<locals>.<genexpr>
  !     H&9daQVVaZ&9   !!r   r   r   r   r'  )r  r{  rV  r  re  r  rr  rY   rj  r   rk  rO  r  r   r   rF   r~  r  )
r[   r   r   r   rn  r`   r  r  r  r  s
             ra   rx   zHoloViewsConverter.quadmesh
  s(   "":.224AqAaAaHdkk&7&7&9HHDAqT^^$Q'AC$//!dmm$!!1Q4)9)9#)>"?@##J/ $ 5 5j A+88 HHF5MD1a&!.v.

 %''(%
T	Uri   c                    | j                  d       ddlm} d| j                  v rLdd lm} | j                  d   }t        ||j                        r!t        ||j                        st        d      | j                  d      \  }	}
| j                  ||||      }| j                  r<dd lm} ddlm} | j                  j                  d|j                         } |||      }|rd|	d	<   |	d
   rd|	d<   | j"                  j                  dd      }t        |t$              r||	d<    ||||      j'                  | j(                  |	|
      S )Nrv   r   )contoursr   zcinvalid transform: Spherical contouring is not supported -  consider using PlateCarree/RotatedPole.r   )r   rp  
line_alphar   Fr  r   r  ru  )r   r   r'  )r  holoviews.operationr  rd  cartopy.crsr   r*  CRS
ProjectionrE  r  rx   r   r  r   r  rD  ri  r9  r~  r  )r[   r   r   r   rn  r   r  r|  r+  r  r  qmeshr   r   r   s                  ra   rv   zHoloViewsConverter.contour  s3   ""9-04??*&-A!TXX&z!T__/M ?  !% 5 5j A+aAt,88&(,,\4;O;OPJEj9E%&H\"J&+H]#x+fc"'-H^$fV<BB##hK C 
 	
ri   c                    | j                  d       | j                  ||||d      }| j                  d   dk7  rF|j                  d   j                  }|| j                  d   i} |j
                  j                  di |S |S )Nrw   T)r   r   r6  r   rr   )r  rv   rk  r[  rV   r  r  )r[   r   r   r   rn  rw   z_namer  s           ra   rw   zHoloViewsConverter.contourf(  s    "":.<<1ad<;
 C L0^^A&++FT--c23E'8>>''0%00Ori   c                    | j                  d       | j                  |||d       \  }}}}|r|s-t        d |j                  j	                         D              \  }}| j
                  j                  d      }| j
                  j                  d      }||g| j                  z   }| j                  |d   | j                  d   i      }t        | j                        }	| j                  d      }
| j                  d      \  }}| j                  r| j                  |	d	<   t!         |
|||g|fi |	fi |j#                  | j$                  ||
      S )Nr~   r   c              3   F   K   | ]  \  }}|j                   d kD  s|  ywr  r  r  s      ra   r  z1HoloViewsConverter.vectorfield.<locals>.<genexpr>;  r  r  r   r   r3   r   r%   r   r'  )r  r{  rV  r  re  ri  r  rr  r   rk  rY   rj  rO  r  r   r   rF   r~  r  )r[   r   r   r   r   rn  r  r   r  r`   r  r  r  s                ra   r~   zHoloViewsConverter.vectorfield6  s;   ""=1224A2FaAaHdkk&7&7&9HHDAq		g&iimmE"CL4??*!!1Q4)9)9#)>"?@dmm$##M2 $ 5 5m D+88 HHF5MD1a&!.v.

 %''(%
T	Uri   c                    | j                  |||d       \  }}}}t        | j                        }|r|sSt        |      r| j                  rdnd\  }}n4| j
                  r| j                  d dd   \  }}n|j                  d d \  }}| j                  | j                  r| j                  | j                  d   ini       }| j                  ||gg       \  }}	| j
                  rt        |      j                  }	| j                  |      }
| j                  |
j                         \  }}||fD ]Q  }d|v r"|d   |	v rt#        j$                  |d         |d<   d|v s.|d	v s3|	r6|d   D cg c]
  }|d
k7  s	| c}|d<   S | j                  r| j&                  |d<   | j(                  rj t        || j(                  |z   |	      j*                  |
||	| j(                  fi |}| j,                  r|j/                  d      }n|j1                  d      }n |
|||	fi |}t3        |fi |j5                  |
j                   |id      j5                  |
j                   |i| j6                        S c c}w )Nr  )rV  rW  )r   r   r  r~  r   r   r%  )r}   r|   r'  r   Fr  rQ   r  )r{  rY   rj  rI   r   r  r  r   r   r_  rk  r  r   r[  rO  r  rV   r  r/   r   r   r  rJ  r  r  rF   r  rO  )r[   r   r   rn  r   r  r`   r  rY  r[  r  r  r  r  r+  r  s                   ra   
_geom_plotzHoloViewsConverter._geom_plotP  s\   224A2FaAdmm$at$48HH0*1""~~eqe,1||BQ'1!!8<T__d..s34R
 ++QFB7uDM''E##D) $ 5 5gll C+,E%E'Ne$;!#g!7g%D,A$A%-27^!L^qG|!^!Lg - 88 HHF5M77:'$%7::tww28C }}jjej,kkuk-$u77C 3 % T7<<*GT<T7<<-t7K7KTL	
 "Ms   '
I*2I*c                 N    | j                  d       | j                  |||d      S )Nr}   r  r  r  r  s       ra   r}   zHoloViewsConverter.polygons}  s'    "":.q!T
;;ri   c                 N    | j                  d       | j                  |||d      S )Nr|   r  r  r  s       ra   r|   zHoloViewsConverter.paths  s'    ""7+q!T88ri   c                 N    | j                  d       | j                  |||d      S )Nrz   r  r  r  s       ra   rz   zHoloViewsConverter.points  s'    ""8,q!T99ri   )rQ   )	holoviews)r  rl   r  )NNN)NNNN)NNNNF)NNNNN)NNNr}   )lrm   rn   ro   rp   r  _geom_typesrG  r?  r  rH  rK  rI  rL  rJ  r\  r   r   r   r   r   r   r   r   r$   r   r   r"   r   r   r   r   r&   r!   r    r   r#   r   r%   r   r  r[  rU  rQ  ccpaletterb  r  ra  r`  r<  r9  rR  rY  rl  r  r  r  r  r  r   r  propertyr_  r  r  r  r  r  r  r  r  r  r  r   r   r   r   r   r  rV  r*  r   r   r3  r   r   r   r   r   r{   r   r   r   r   r   r   r{  rO  ru   ry   rx   rv   rw   r~   r  r}   r|   rz   rr   ri   ra   rt   rt   |   s   ^@ ^NJ'K$'aaJ ?LM 	L%MNN	Kgw' 	= 	*	
 	+ 	I; 	3 	K 	= 	#v 	A 	T 	E 	7 	VSM  	W~!" 	8#$ 	&M'+M2t 	 	Y	
 	z 	8 	H 	7 	< 	Y 		 	 	| 	& 	  	7!" 	7#$ "9M@	O	 " zz"67	N # $Qrh  D+@*~@$@+D2hn`
:
1f&P" A A0	%	?
B$,\#J+
Z-V/1$
 $
c $
L;C,U\LHR
h2
h$R
0
0	
< |U
<>
(#
JU,#
JU4+
Z<9:ri   rt   )lrM  r  	functoolsr   rW   r  r  r  r  numpyr  colorcetr  bokeh.modelsr   holoviews.core.dimensionr   holoviews.core.spacesr   r   r   holoviews.core.overlayr	   holoviews.core.optionsr
   r   r   holoviews.core.layoutr   holoviews.core.utilr   r6  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   holoviews.plotting.bokehr(   r)   holoviews.plotting.utilr*   r  r+   r,   holoviews.streamsr-   r.   holoviews.util.transformr/   r0   r1   r2   backend_transformsr4   utilr5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   	utilitiesrP   rendererrS   rt   rr   ri   ra   <module>r     s     
       " . ? ? , 8 8 * )      6 E 0 5 * E , :       : (2;;w"= "=JK,: K,:ri   