my first d3 voronoi diagram need improvements

Hi ! My experience of writing any code is low, more than 100 hours for a single project maybe 3 or 4 occasions in 10 years before for the current one. I play video games like factorio and document on the code or systems, but that’s it, I have big holes in what should be basic knowledge of langages or syntax or web in general. I found it not so easy to find help that would be both understandable and specific enough to be useful. I hope forum community can help sorry if that sound like an ai prompt.
On this coding occasion,i was able to pull together things from the example on how to use the delaunay/voronoi from the d3.js to make a chart from random points, then smoothen it by replacing those points by the barycenter of the voronoi cell, doing it several time looks great but is slower the more points and i wish to understand what are the good practices to avoid the bad scaling.It get worse because there are rules to color the cells based on their area or location, and the type of the neighbouring cell. It is used to make a mock up video game map with lots of water and others. I added pathfinding/graph traversal using the .neighbours example and later some djiskra implementation i found online.
It is able to generate maps that look as intented and draw the smallest path despite the obstacles but it is probably done in inefficient ways. What do you advise me to do to share those 2 files ? GitHub - Preceti/Fulgora-snapshot-generator
Where (else) would you advise me to look for more information on how to properly use the d3.js ? Any other advice ?