MCPcopy Create free account
hub / github.com/holoviz/hvplot / __init__

Method __init__

hvplot/interactive.py:243–299  ·  view source on GitHub ↗
(
        self,
        obj,
        transform=None,
        fn=None,
        plot=False,
        depth=0,
        loc='top_left',
        center=False,
        dmap=False,
        inherit_kwargs={},
        max_rows=100,
        method=None,
        _shared_obj=None,
        _current=None,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

241 return True
242
243 def __init__(
244 self,
245 obj,
246 transform=None,
247 fn=None,
248 plot=False,
249 depth=0,
250 loc='top_left',
251 center=False,
252 dmap=False,
253 inherit_kwargs={},
254 max_rows=100,
255 method=None,
256 _shared_obj=None,
257 _current=None,
258 **kwargs,
259 ):
260 # _init is used to prevent to __getattribute__ to execute its
261 # specialized code.
262 self._init = False
263 self._method = method
264 if transform is None:
265 dim = '*'
266 transform = hv.util.transform.dim
267 if is_xarray(obj):
268 transform = hv.util.transform.xr_dim
269 if is_xarray_dataarray(obj):
270 dim = obj.name
271 if dim is None:
272 raise ValueError(
273 'Cannot use interactive API on DataArray without name.'
274 'Assign a name to the DataArray and try again.'
275 )
276 elif is_tabular(obj):
277 transform = hv.util.transform.df_dim
278 self._transform = transform(dim)
279 else:
280 self._transform = transform
281 self._plot = plot
282 self._depth = depth
283 self._loc = loc
284 self._center = center
285 self._dmap = dmap
286 # TODO: What's the real use of inherit_kwargs? So far I've only seen
287 # it containing 'ax'
288 self._inherit_kwargs = inherit_kwargs
289 self._max_rows = max_rows
290 self._kwargs = kwargs
291 ds = hv.Dataset(_convert_col_names_to_str(self._obj))
292 if _current is not None:
293 self._current_ = _current
294 else:
295 self._current_ = self._transform.apply(ds, keep_index=True, compute=False)
296 self._init = True
297 self._dirty = False
298 self.hvplot = _hvplot(self)
299 self._setup_invalidations(depth)
300

Callers

nothing calls this directly

Calls 6

_setup_invalidationsMethod · 0.95
is_xarrayFunction · 0.85
is_xarray_dataarrayFunction · 0.85
is_tabularFunction · 0.85
_hvplotClass · 0.85

Tested by

no test coverage detected