diff --git a/packages/react-components/src/components/timegraph-output-component.tsx b/packages/react-components/src/components/timegraph-output-component.tsx index a2a3452b8..91499117b 100644 --- a/packages/react-components/src/components/timegraph-output-component.tsx +++ b/packages/react-components/src/components/timegraph-output-component.tsx @@ -109,9 +109,7 @@ export class TimegraphOutputComponent extends AbstractTreeOutputComponent 0) { treeResponse.model.headers.forEach(header => { @@ -120,21 +118,11 @@ export class TimegraphOutputComponent extends AbstractTreeOutputComponent this.isVisible(entry)); + this.totalHeight = visibleEntries.length * this.props.style.rowHeight; + this.rowController.totalHeight = this.totalHeight; + } + + private isVisible(entry: TimeGraphEntry): boolean { + let parentId = entry.parentId; + while (parentId !== undefined && parentId !== -1) { + if (this.state.collapsedNodes.includes(parentId)) { + return false; + } + const parent = this.state.timegraphTree.find(e => e.id === parentId); + parentId = parent ? parent.parentId : undefined; + } + return true; } private onSelectionChanged(payload: { [key: string]: number }) {