canvas {
border: 1px solid red;
height: 600px;
width: 600px;
}
const WIDTH = 600
const HEIGHT = 600
const NODE_LIST = [
{
x: 10,
y: 20,
width: 30,
height: 30,
text: 'rect1'
},
{
x: 50,
y: 100,
height: 300,
width: 300,
text: 'rect2',
children: [
{
x: 100,
y: 150,
height: 200,
width: 200,
text: 'rect2-1',
children: [
{
x: 140,
y: 200,
height: 50,
width: 40,
text: 'rect2-1-1',
},
{
x: 220,
y: 200,
height: 50,
width: 40,
text: 'rect2-1-2',
}
]
}
]
}</