Files
url_tracker_tool/node_modules/non-layered-tidy-tree-layout/test/tree-node.js
Andrei 58f8093689 Rebrand from 'Redirect Intelligence v2' to 'URL Tracker Tool V2' throughout UI
- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
2025-08-19 19:12:23 +00:00

24 lines
508 B
JavaScript

export default class TreeNode {
constructor(width, height) {
this.width = width
this.height = height
this.x = 0
this.y = 0
this.children = []
}
addChild(child) {
child.y = this.y + this.height
this.children.push(child)
}
randExpand(tree) {
tree.y += this.height
const i = Math.floor(Math.random() * (this.children.length + 1))
if (i === this.children.length) {
this.children.push(tree)
} else {
this.children[i].randExpand(tree)
}
}
}