Skip to content

Commit 43d945b

Browse files
committed
tally
1 parent d689c74 commit 43d945b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/summary-table.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ function table(data, options = {}) {
6868
const summaries = th.append("div").classed("summary", true);
6969

7070
const textFields = fields.filter(({type}) => type === "Utf8");
71+
const tally = html`<div style="position: absolute; right: 0;">${data.numRows.toLocaleString("en-US")} rows</div>`;
7172
const footer = html`<footer style="width: 100%; height: 1em;">
7273
${textFields.length ? html`<div style="position: absolute; left: 0;"><input type="search" placeholder="Search text fields" onkeyup=${search} onchange=${search}></div>` : ""}
73-
<div style="position: absolute; right: 0;">${data.numRows.toLocaleString("en-US")} rows</div>
74+
${tally}
7475
</footer>`;
7576
container.appendChild(footer);
7677

@@ -97,6 +98,8 @@ function table(data, options = {}) {
9798
const th = d3.select(table).selectAll("th");
9899
th.append((d, i) => thtype[i]);
99100
th.append((d, i) => thsummary[i]);
101+
102+
tally.innerHTML = index === index0 ? `${index.length} rows` : `<b>${index.length}</b> / ${index0.length}`;
100103
}
101104

102105
function take(data, index) {

0 commit comments

Comments
 (0)