MCPcopy
hub / github.com/apache/echarts / updateDepthAndHeight

Method updateDepthAndHeight

src/data/Tree.ts:140–151  ·  view source on GitHub ↗

* Update depth and height of this subtree.

(depth: number)

Source from the content-addressed store, hash-verified

138 * Update depth and height of this subtree.
139 */
140 updateDepthAndHeight(depth: number) {
141 let height = 0;
142 this.depth = depth;
143 for (let i = 0; i < this.children.length; i++) {
144 const child = this.children[i];
145 child.updateDepthAndHeight(depth + 1);
146 if (child.height > height) {
147 height = child.height;
148 }
149 }
150 this.height = height + 1;
151 }
152
153 getNodeById(id: string): TreeNode {
154 if (this.getId() === id) {

Callers 1

createTreeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected