update groupBy methods

This commit is contained in:
joshuashoemaker 2022-06-26 01:09:50 -05:00
parent 592eb5697d
commit c40fbea756

View File

@ -10,7 +10,7 @@ class GroupByNodule extends Nodule_1.default {
this.setGroupByValue(props.groupByValue); this.setGroupByValue(props.groupByValue);
} }
asTables = () => { asTables = () => {
const exports = this.exportTables(); const exports = this.exportRowGroups();
const tables = []; const tables = [];
for (let key in exports) { for (let key in exports) {
const newTableProps = { const newTableProps = {
@ -29,7 +29,7 @@ class GroupByNodule extends Nodule_1.default {
export = () => { export = () => {
throw new Error('"export()" can not be called by GroupByNodule. Call "exportTables()"'); throw new Error('"export()" can not be called by GroupByNodule. Call "exportTables()"');
}; };
exportTables = () => { exportRowGroups = () => {
const { groupByValue } = this; const { groupByValue } = this;
const rows = this.tables.map(t => t.export()).flat(); const rows = this.tables.map(t => t.export()).flat();
const groupedByRows = rows.reduce((groups, r) => { const groupedByRows = rows.reduce((groups, r) => {