Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
columns checked by default + 📋 list of most frquent values
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromedockes committed Jan 15, 2024
1 parent b844c40 commit b538331
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
10 changes: 9 additions & 1 deletion src/skrubview/_data/templates/column-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h3 class="skrubview-margin-r-t">
<code class="skrubview-select-all">{{ column.name }}</code>
</h3>
<input class="skrubview-select-column-checkbox" type="checkbox" onchange="updateColSelection(event)" data-column-id="{{ col_id }}" data-report-id="{{ report_id }}" />
<input class="skrubview-select-column-checkbox" type="checkbox" onchange="updateColSelection(event)" data-column-id="{{ col_id }}" data-report-id="{{ report_id }}" checked />
<code class="skrubview-float-end">{{ column.dtype }}</code>
</div>
<div class="skrubview-column-summary-content skrubview-wrapper">
Expand Down Expand Up @@ -71,6 +71,14 @@ <h3 class="skrubview-margin-r-t">
<pre class="skrubview-box" id="{{ val_id }}">{{ value }}</pre>
<button onclick='copyTextToClipboard("{{ val_id }}")'>📋</button>
{% endfor %}
{% set val_id = "{}-freq-value-all".format(col_id) %}
<strong>List:</strong><span></span>
<pre class="skrubview-box" id="{{ val_id }}">{{ "[" }}
{%- for value in column.value_counts -%}
{{ value.__repr__() }}{{", " if not loop.last }}
{%- endfor -%}
{{ "]" }}</pre>
<button onclick='copyTextToClipboard("{{ val_id }}")'>📋</button>
</div>
</details>
{% endif %}
Expand Down
10 changes: 4 additions & 6 deletions src/skrubview/_data/templates/dataframe-columns.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{% from "utils.j2" import compact_id, collapse_const_id with context %}
<article class="skrubview-wrapper">
<div>
<p>Selected columns:</p>
<code class="skrubview-selected-columns" id="{{ report_id }}-selected-columns"></code>
<p>
<strong>Column names</strong> (check/uncheck columns below to add/remove):
<div class="skrubview-flex skrubview-margin-v-t">
<pre class="skrubview-box skrubview-selected-columns" id="{{ report_id }}-selected-columns"></pre>
<button onclick='copyTextToClipboard("{{ report_id }}-selected-columns")'>📋</button>
<button onclick='clearSelectedCols("{{ report_id }}")'>Clear</button>
<button onclick='selectAllCols("{{ report_id }}")'>Select all</button>
<button onclick='copyTextToClipboard("{{ report_id }}-selected-columns")'>📋</button>
</p>
</div>
{% if summary.n_constant_columns %}
<input type="checkbox" id="{{ collapse_const_id }}" checked="true" />
Expand Down

0 comments on commit b538331

Please sign in to comment.