From 4b684d6ef838d55f73361f6c3d91ae55ddd345d7 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Fri, 26 Apr 2024 13:25:06 +0200 Subject: [PATCH] display nb of filtered columns + open on sample tab by default --- src/skrubview/_data/templates/dataframe-sample.html | 2 +- src/skrubview/_data/templates/report.html | 2 +- src/skrubview/_data/templates/skrubview.js | 1 + src/skrubview/_html.py | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/skrubview/_data/templates/dataframe-sample.html b/src/skrubview/_data/templates/dataframe-sample.html index 405bf01..f8e7dcb 100644 --- a/src/skrubview/_data/templates/dataframe-sample.html +++ b/src/skrubview/_data/templates/dataframe-sample.html @@ -55,7 +55,7 @@

- {{ summary.n_rows }} rows ✕ {{ summary.n_columns }} columns. + {{ summary.n_rows }} rows ✕ {{ summary.n_columns }} columns.

diff --git a/src/skrubview/_data/templates/report.html b/src/skrubview/_data/templates/report.html index 96eb36a..87ec58e 100644 --- a/src/skrubview/_data/templates/report.html +++ b/src/skrubview/_data/templates/report.html @@ -33,6 +33,6 @@

{{ summary.title }}

diff --git a/src/skrubview/_data/templates/skrubview.js b/src/skrubview/_data/templates/skrubview.js index 07dfe7e..c8fc40d 100644 --- a/src/skrubview/_data/templates/skrubview.js +++ b/src/skrubview/_data/templates/skrubview.js @@ -180,4 +180,5 @@ function onFilterChange(colFilterId) { elem.dataset.isExcludedByFilter = ""; } }) + document.getElementById(`${reportId}_display_n_columns`).textContent = acceptedCols.length.toString(); } diff --git a/src/skrubview/_html.py b/src/skrubview/_html.py index 7fa54b5..bc44020 100644 --- a/src/skrubview/_html.py +++ b/src/skrubview/_html.py @@ -41,6 +41,8 @@ def _get_column_filters(dataframe): ~s.string(), s.categorical(), ~s.categorical(), + s.any_date(), + ~s.any_date(), ]: filters[re.sub(r"^\((.*)\)$", r"\1", repr(selector))] = selector.expand( dataframe