diff --git a/packages/datalib/src/PerspectiveDisplay.ts b/packages/datalib/src/PerspectiveDisplay.ts index 4781ae318..c0d58f6e2 100644 --- a/packages/datalib/src/PerspectiveDisplay.ts +++ b/packages/datalib/src/PerspectiveDisplay.ts @@ -95,7 +95,12 @@ export class PerspectiveDisplay { // this.mergeRows(collectedRows); this.mergeRows(collectedRows); // dbg('merged rows', this.rows); - // console.log('MERGED', this.rows); + // console.log( + // 'MERGED', + // this.rows.map(r => + // r.incompleteRowsIndicator ? `************************************ ${r.incompleteRowsIndicator.join('|')}` : r.rowData.join('|') + // ) + // ); } fillColumns(children: PerspectiveTreeNode[], parentNodes: PerspectiveTreeNode[]) { diff --git a/packages/web/src/perspectives/PerspectiveTable.svelte b/packages/web/src/perspectives/PerspectiveTable.svelte index ee6a62bfd..1553e780d 100644 --- a/packages/web/src/perspectives/PerspectiveTable.svelte +++ b/packages/web/src/perspectives/PerspectiveTable.svelte @@ -34,23 +34,30 @@ ...loadProps, topCount: counts[node.uniqueName] || 100, }); - if (incomplete) { - rows = [ - ...rows, - { - incompleteRowsIndicator: [node.uniqueName], - }, - ]; - } // console.log('ROWS', rows, node.isRoot); if (node.isRoot) { parentRows.push(...rows); // console.log('PUSH PARENTROWS', parentRows); + + if (incomplete) { + parentRows.push({ + incompleteRowsIndicator: [node.uniqueName], + }); + } } else { + let lastRowWithChildren = null; for (const parentRow of parentRows) { const childRows = rows.filter(row => node.matchChildRow(parentRow, row)); parentRow[node.fieldName] = childRows; + if (childRows.length > 0) { + lastRowWithChildren = parentRow; + } + } + if (incomplete && lastRowWithChildren) { + lastRowWithChildren[node.fieldName].push({ + incompleteRowsIndicator: [node.uniqueName], + }); } }