Given a standard nested circular treemap, how do you calculate the where to place the circles?
Your main problem can be described as this: "Given a set of circles of varying radius, how does one place them within a larger circle, so that none of them overlap
".
It's a hard problem, but here's a brute force solution to get you started:
The above uses the observation that in a perfect packing, every circle must border to at least two other circles. You can use the algorithm to provide a full search, or you can just iterate randomly and greedily choose the first available spot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With