Skip to content

Commit 1c54a2f

Browse files
committed
update tree
1 parent 7e4f3d6 commit 1c54a2f

File tree

1 file changed

+0
-117
lines changed

1 file changed

+0
-117
lines changed

dev-reactime/tree.js

Lines changed: 0 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<<<<<<< HEAD
2-
=======
31
/* eslint-disable no-multiple-empty-lines */
42
/* eslint-disable max-classes-per-file */
53
/* eslint-disable no-console */
@@ -47,72 +45,6 @@ class Tree {
4745
}
4846
return copy;
4947

50-
// This is a regular old tree version of the above, but above version
51-
// is better suited for D3 chart displays
52-
// class Tree {
53-
// constructor(state, name = 'nameless', index) {
54-
// this.state = state === 'root' ? 'root' : JSON.parse(JSON.stringify(state));
55-
// this.name = name;
56-
// this.index = index;
57-
// this.child = null;
58-
// this.sibling = null;
59-
// }
60-
61-
// setNode(state, name, index) {
62-
// this.state = { ...this.child.state, ...state };
63-
// this.name = name;
64-
// this.index = index;
65-
// }
66-
67-
// appendToChild(state, name = this.name, index = this.index) {
68-
// if (this.child) {
69-
// this.child.state = { ...this.child.state, ...state };
70-
// this.child.name = name;
71-
// this.child.index = index;
72-
// } else {
73-
// this.child = new Tree(state, name, index);
74-
// }
75-
// }
76-
77-
// appendToSibling(state, name = this.name, index = this.index) {
78-
// if (this.sibling) {
79-
// state = { ...this.sibling.state, ...state };
80-
// this.sibling.name = name;
81-
// this.sibling.index = index;
82-
// } else {
83-
// this.sibling = new Tree(state, name, index);
84-
// }
85-
// }
86-
87-
// cleanTreeCopy() {
88-
// const copy = new Tree(this.state, this.name, this.index);
89-
// if (this.sibling) {
90-
// copy.sibling = new Tree(this.sibling.state, this.sibling.name, this.sibling.index);
91-
// copy.sibling = scrubUnserializableMembers(copy.sibling);
92-
// copy.sibling = this.sibling.sibling;
93-
// copy.sibling.cleanTreeCopy();
94-
// }
95-
96-
// if (this.child) {
97-
// copy.child = new Tree(this.child.state, this.child.name, this.child.index);
98-
// copy.child = scrubUnserializableMembers(copy.child);
99-
// copy.child = this.child.child;
100-
// copy.child.cleanTreeCopy();
101-
// }
102-
//
103-
// // unfinished:
104-
// cleanD3Copy(children = []) {
105-
// copy = D3Tree(this.state, this.name, this.index, this.isStateless);
106-
// let nextSibling = this.sibling;
107-
// while(nextSibling = this.sibling) {
108-
// copy.cleanD3Copy(copy.)
109-
// }
110-
111-
}
112-
113-
// return copy;
114-
// }
115-
11648
// print out the tree structure in the console
11749
// DEV: Process may be different for useState components
11850
// BUG FIX: Don't print the Router as a component
@@ -134,53 +66,4 @@ class Tree {
13466
}
13567
}
13668

137-
// class UnfilteredTreeNode extends Tree {
138-
// constructor(component, useStateInstead = false, name, unfilteredProps) {
139-
// super(component, useStateInstead, name);
140-
// // this.isStateful = unfilteredProps.isStateful;
141-
// // this.tagLabel = reactWorkTags[unfilteredProps.tag];
142-
// if(unfilteredProps) {
143-
// this.tag = unfilteredProps.tag;
144-
// this.actualDuration = unfilteredProps.actualDuration;
145-
// this.actualStartTime = unfilteredProps.actualStartTime;
146-
// this.selfBaseDuration = unfilteredProps.selfBaseDuration;
147-
// this.treeBaseDuration = unfilteredProps.treeBaseDuration;
148-
// }
149-
// }
150-
151-
// appendChild(component) {
152-
// const newChild = new UnfilteredTreeNode(component);
153-
// this.children.push(newChild);
154-
// return newChild;
155-
// }
156-
// }
157-
15869
module.exports = Tree
159-
// module.exports = {
160-
// Tree,
161-
// UnfilteredTreeNode,
162-
// };
163-
164-
165-
166-
167-
// // print out the tree structure in the console
168-
// // DEV: Process may be different for useState components
169-
// // BUG FIX: Don't print the Router as a component
170-
// // Change how the children are printed
171-
// print() {
172-
// console.log("current tree structure for *this : ", this);
173-
// const children = ['children: '];
174-
// // DEV: What should we push instead for components using hooks (it wouldn't be state)
175-
// this.children.forEach(child => { // if this.children is always initialized to empty array, when would there ever be anything to iterate through here?
176-
// children.push(child.state || child.component.state);
177-
// });
178-
// if (this.name) console.log("this.name if exists: ", this.name);
179-
// if (children.length === 1) {
180-
// console.log(`children length 1. ${this.state ? `this.state: ` : `this.component.state: `}`, this.state || this.component.state);
181-
// } else console.log(`children length !== 1. ${this.state ? `this.state: ` : `this.component.state, children: `}`, this.state || this.component.state, ...children);
182-
// this.children.forEach(child => {
183-
// child.print();
184-
// });
185-
// }
186-
>>>>>>> master

0 commit comments

Comments
 (0)