As of now, the calculations for the Binary tree positioning happens in the render code for the canvas. This is very poor design on my part, but I was aiming for an MVP. If the code gets improved, then we can include animations!
Why
If we attempt to animate the canvas, the visuals flicker.
How
First, the p5 code will need to be calculated once and the result added to an array or object with the cords stored inside. Then during the render, just display the array/obj items per frame, rather than constantly doing the calculations.
What needs to be done.
As of now, the calculations for the Binary tree positioning happens in the render code for the canvas. This is very poor design on my part, but I was aiming for an MVP. If the code gets improved, then we can include animations!
Why
If we attempt to animate the canvas, the visuals flicker.
How
First, the p5 code will need to be calculated once and the result added to an array or object with the cords stored inside. Then during the render, just display the array/obj items per frame, rather than constantly doing the calculations.