siblingAutogroupNode.tsx 837 B

12345678910111213141516171819202122232425262728
  1. import {computeCollapsedBarSpace} from './parentAutogroupNode';
  2. import type {TraceTree} from './traceTree';
  3. import {TraceTreeNode} from './traceTreeNode';
  4. export class SiblingAutogroupNode extends TraceTreeNode<TraceTree.SiblingAutogroup> {
  5. groupCount: number = 0;
  6. profiles: TraceTree.Profile[] = [];
  7. private _autogroupedSegments: [number, number][] | undefined;
  8. constructor(
  9. parent: TraceTreeNode<TraceTree.NodeValue> | null,
  10. node: TraceTree.SiblingAutogroup,
  11. metadata: TraceTree.Metadata
  12. ) {
  13. super(parent, node, metadata);
  14. this.expanded = false;
  15. }
  16. get autogroupedSegments(): [number, number][] {
  17. if (this._autogroupedSegments) {
  18. return this._autogroupedSegments;
  19. }
  20. this._autogroupedSegments = computeCollapsedBarSpace(this.children);
  21. return this._autogroupedSegments;
  22. }
  23. }