Skip to content

Commit

Permalink
Ydata profiling view (#613)
Browse files Browse the repository at this point in the history
Co-authored-by: Philipp Rudiger <[email protected]>
  • Loading branch information
ahuang11 and philippjfr authored Jul 24, 2024
1 parent 286d365 commit b9712d9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lumen/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,4 +1129,22 @@ def get_panel(self) -> pn.pane.Vega:
return pn.pane.Vega(**self._normalize_params(self._get_params()))


class YdataProfilingView(View):
"""
A View that renders a ydata_profiling ProfileReport.
"""

view_type = 'ydata_profiling'

_panel_type = pn.pane.HTML

def _get_params(self) -> Dict[str, Any]:
df = self.get_data()
return dict(df=df, **self.kwargs)

def get_panel(self) -> pn.pane.HTML:
from ydata_profiling import ProfileReport
return self._panel_type(ProfileReport(**self._get_params()).html)


__all__ = [name for name, obj in locals().items() if isinstance(obj, type) and issubclass(obj, View)] + ["Download"]

0 comments on commit b9712d9

Please sign in to comment.