diff --git a/hvplot/plotting/core.py b/hvplot/plotting/core.py index c20dffdd4..3522df345 100644 --- a/hvplot/plotting/core.py +++ b/hvplot/plotting/core.py @@ -1909,6 +1909,19 @@ def _get_converter(self, x=None, y=None, kind=None, **kwds): return HoloViewsConverter(data, x, y, kind=kind, **params) + def explorer(self, x=None, y=None, **kwds): + import polars as pl + from ..ui import explorer as ui_explorer + + if isinstance(self._data, (pl.DataFrame, pl.Series)): + data = self._data.to_pandas() + elif isinstance(self._data, pl.LazyFrame): + data = self._data.collect().to_pandas() + else: + raise ValueError('Only Polars DataFrame, Series, and LazyFrame are supported') + + return ui_explorer(data, x=x, y=y, **kwds) + class hvPlot(hvPlotTabular): """ diff --git a/hvplot/ui.py b/hvplot/ui.py index ee6f260b0..5fa40eebb 100644 --- a/hvplot/ui.py +++ b/hvplot/ui.py @@ -1031,7 +1031,9 @@ def ylim(self): y = self._y if not isinstance(y, list): y = [y] - values = [ys for ys in (self._data[y] for y in y) if len(ys)] + values = [ + ys for ys in (self._data[y] for y in y) if len(ys) and ys.dtype.kind not in 'OSU' + ] if not len(values): return (np.nan, np.nan) return max_range([(np.nanmin(vs), np.nanmax(vs)) for vs in values])